talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

Adding and removing fields from the Advanced Search page

PM
Peter Murray
Thu, Nov 12, 2015 4:07 PM

I have a field that I would like to add to the Advanced Search page and one that I'd like to remove.  Adding the field seems straight forward -- the Config Fields reference doc says to add a ui-search attribute to the element:

https://wiki.collectionspace.org/display/DOC/cspace-config+Fields?src=search#cspace-configFields-ui-search

That doesn't seem to be working though -- is this right?

https://github.com/cherryhill/sdmom-tenant-config/blob/fe8a5aa26983332e5cc75438ccae82090eb03d93/application/sdmom-collectionobject.xml#L49-L51

I have rebuilt the code and am running with the Chrome Developer Tools option to "Disable Cache (while DevTools is open)", so I think there is something in the configuration that I'm missing.

Secondly, there is a field from the advanced search page that is not being used, but it is the base schema.  The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer.  I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.

Peter

Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company

I have a field that I would like to add to the Advanced Search page and one that I'd like to remove. Adding the field seems straight forward -- the Config Fields reference doc says to add a ui-search attribute to the element: https://wiki.collectionspace.org/display/DOC/cspace-config+Fields?src=search#cspace-configFields-ui-search That doesn't seem to be working though -- is this right? https://github.com/cherryhill/sdmom-tenant-config/blob/fe8a5aa26983332e5cc75438ccae82090eb03d93/application/sdmom-collectionobject.xml#L49-L51 I have rebuilt the code and am running with the Chrome Developer Tools option to "Disable Cache (while DevTools is open)", so I think there is something in the configuration that I'm missing. Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag. Peter -- Peter Murray Dev/Ops Lead and Project Manager Cherry Hill Company
PM
Peter Murray
Thu, Nov 12, 2015 4:31 PM

Right after sending the last message, I had a thought about a way to remove a field from the advanced search:

On Nov 12, 2015, at 11:07 AM, Peter Murray pmurray@chillco.com wrote:

Secondly, there is a field from the advanced search page that is not being used, but it is the base schema.  The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer.  I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.

I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty:

https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11

Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded".  This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema....

Peter

Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company

Right after sending the last message, I had a thought about a way to remove a field from the advanced search: > On Nov 12, 2015, at 11:07 AM, Peter Murray <pmurray@chillco.com> wrote: > > Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag. I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty: https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11 Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded". This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema.... Peter -- Peter Murray Dev/Ops Lead and Project Manager Cherry Hill Company
RL
Ray Lee
Thu, Nov 12, 2015 9:18 PM

Hi Peter,
To remove a field from advanced search you have to edit the HTML template
in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html.

You've hit on the right way to remove attributes in the app layer. There's
no way to remove them completely via XML merge, but you can override them
to be empty, and hope the app layer treats the empty string the same as a
non-existent attribute. In most cases, it does.

To remove a field from search you don't have to remove the
search="repeatable" attribute in the app layer config, it's sufficient to
remove the markup from the UI. If you do remove the search attribute, the
only difference is that field will be removed from the uispec payload that
is sent from the app layer to the UI, so you save a few bytes there. I
don't think it's worth the effort.

Ray

On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray pmurray@chillco.com wrote:

Right after sending the last message, I had a thought about a way to
remove a field from the advanced search:

On Nov 12, 2015, at 11:07 AM, Peter Murray pmurray@chillco.com wrote:

Secondly, there is a field from the advanced search page that is not

being used, but it is the base schema.  The documentation has a How-To on
suppressing fields in the UI without removing them from the base schema (
https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields),
but of course the schema is being read and processed at the application
layer.  I haven't dug deep into how XMLmerge works, so I'm hoping someone
can offer some advice on the required incantation in the merge file to
remove the ui-search element from the field tag.

I wondered what would happen if I used XMLmerge to set the 'ui-search' and
'mini' fields to empty:

https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11

Interestingly, what happened was that the field sort of still exists in
the UI: the label disappears and the pulldown <select> list has only
"Options not loaded".  This is leading me to believe that the Advanced
Search fields are actually defined somewhere else in addition to being in
the record schema....

Peter

Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company


Talk mailing list
Talk@lists.collectionspace.org

http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

Hi Peter, To remove a field from advanced search you have to edit the HTML template in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html. You've hit on the right way to remove attributes in the app layer. There's no way to remove them completely via XML merge, but you can override them to be empty, and hope the app layer treats the empty string the same as a non-existent attribute. In most cases, it does. To remove a field from search you don't have to remove the search="repeatable" attribute in the app layer config, it's sufficient to remove the markup from the UI. If you do remove the search attribute, the only difference is that field will be removed from the uispec payload that is sent from the app layer to the UI, so you save a few bytes there. I don't think it's worth the effort. Ray On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray <pmurray@chillco.com> wrote: > Right after sending the last message, I had a thought about a way to > remove a field from the advanced search: > > > On Nov 12, 2015, at 11:07 AM, Peter Murray <pmurray@chillco.com> wrote: > > > > Secondly, there is a field from the advanced search page that is not > being used, but it is the base schema. The documentation has a How-To on > suppressing fields in the UI without removing them from the base schema ( > https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), > but of course the schema is being read and processed at the application > layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone > can offer some advice on the required incantation in the merge file to > remove the ui-search element from the field tag. > > I wondered what would happen if I used XMLmerge to set the 'ui-search' and > 'mini' fields to empty: > > > https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11 > > Interestingly, what happened was that the field sort of still exists in > the UI: the label disappears and the pulldown <select> list has only > "Options not loaded". This is leading me to believe that the Advanced > Search fields are actually defined somewhere else in addition to being in > the record schema.... > > > Peter > -- > Peter Murray > Dev/Ops Lead and Project Manager > Cherry Hill Company > > > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > > http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org >
PM
Peter Murray
Thu, Nov 12, 2015 9:42 PM

On Nov 12, 2015, at 4:18 PM, Ray Lee rhlee@berkeley.edu wrote:

Hi Peter,
To remove a field from advanced search you have to edit the HTML template in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html.

You've hit on the right way to remove attributes in the app layer. There's no way to remove them completely via XML merge, but you can override them to be empty, and hope the app layer treats the empty string the same as a non-existent attribute. In most cases, it does.

To remove a field from search you don't have to remove the search="repeatable" attribute in the app layer config, it's sufficient to remove the markup from the UI. If you do remove the search attribute, the only difference is that field will be removed from the uispec payload that is sent from the app layer to the UI, so you save a few bytes there. I don't think it's worth the effort.

Ray

On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray <pmurray@chillco.com mailto:pmurray@chillco.com> wrote:
Right after sending the last message, I had a thought about a way to remove a field from the advanced search:

On Nov 12, 2015, at 11:07 AM, Peter Murray <pmurray@chillco.com mailto:pmurray@chillco.com> wrote:

Secondly, there is a field from the advanced search page that is not being used, but it is the base schema.  The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer.  I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.

I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty:

https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11 https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11

Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded".  This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema....

Peter

--
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company

Ah! There it is. Thanks, Ray. I've added a note to the "How to hide a field or group of fields" page in the Unreleased documentation: https://wiki.collectionspace.org/display/UNRELEASED/How+to+hide+a+field+or+group+of+fields#Howtohideafieldorgroupoffields-Specialcasesandwordsofwarning <https://wiki.collectionspace.org/display/UNRELEASED/How+to+hide+a+field+or+group+of+fields#Howtohideafieldorgroupoffields-Specialcasesandwordsofwarning> Peter > On Nov 12, 2015, at 4:18 PM, Ray Lee <rhlee@berkeley.edu> wrote: > > Hi Peter, > To remove a field from advanced search you have to edit the HTML template in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html. > > You've hit on the right way to remove attributes in the app layer. There's no way to remove them completely via XML merge, but you can override them to be empty, and hope the app layer treats the empty string the same as a non-existent attribute. In most cases, it does. > > To remove a field from search you don't have to remove the search="repeatable" attribute in the app layer config, it's sufficient to remove the markup from the UI. If you do remove the search attribute, the only difference is that field will be removed from the uispec payload that is sent from the app layer to the UI, so you save a few bytes there. I don't think it's worth the effort. > > Ray > > > > > On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray <pmurray@chillco.com <mailto:pmurray@chillco.com>> wrote: > Right after sending the last message, I had a thought about a way to remove a field from the advanced search: > > > On Nov 12, 2015, at 11:07 AM, Peter Murray <pmurray@chillco.com <mailto:pmurray@chillco.com>> wrote: > > > > Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields <https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields>), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag. > > I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty: > > https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11 <https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11> > > Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded". This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema.... > > > Peter -- Peter Murray Dev/Ops Lead and Project Manager Cherry Hill Company