How to change the columns in the search results
This is an older document that requires substantial revision to be brought up to current documentation standards. Some of the instructions in this document are also outdated and require modification.
It is included here as a placeholder, even prior to being revised, as an experienced CollectionSpace implementer may yet be able to obtain the information they need by carefully parsing this document.
reviewed by chris M
I think it makes sense
This document requires updating for v1.9:
- This change will need to be made in a tenant-specific application layer configuration file.
- There may be some additional material that can be incorporated into this document from the notes on How to configure summary fields.
- This document might reflect a common style that references external documents on how to make and deploy tenant-specific changes, such as the style used in How to rename a field.
How to Change the Columns in the Search Results
Columns in the search results can be changed if changes are made in both the UI and Application layers. All procedures and object records handle search in the same way. Before you can select a field to be a column in a search result, you must add the attribute mini="list", or append the parameter "list" to an existing attribute called "mini' for that field in the cspace-config file.
- To find the cspace-config file: unified collectionspace config
- Documentation about the mini attribute: cspace-config Fields#mini
Once the attribute mini="list has been adding for the field in the cspace-config file, a user may view the results of a search. Results are paginated, and a simple text summary is listed (for example, number and name). Clicking on a result takes the user into that record's information edit page.
The results of a search are displayed in the following ways:
- Results are usually displayed in a list, but there are various ways of looking at the list.
- The columns in the search results can be changed and you can customize the list to include anything in CSpace.
- The results of the search can be displayed in the right hand side bar.
Task Description
Before a search is initiated, the 'mini' attribute must be configured for the fields to be searched. The next table shows the parameters of the 'mini' attribute.
Parameter |
Description |
---|---|
mini="list" defined |
Set of strings from number|summary|list that defines the fields that are used in find and edit and search results. |
mini default |
default "" |
mini number |
Only one field can be set as number. |
mini summary |
Only one field can be set as summary |
mini="list" (New) |
Multiple fields can be set as list. The list mini is used in Find & Edit page and in lists on tabs to set the required columns. |
mini="search" (New) |
Multiple fields can be set as list. Selected fields are used in the search results to set the required columns . |
mini="relate" (New) |
Multiple fields can be set as list. Relate minis are used in the RH related Object and relatedProcedures to set the required columns. Note: Reference only. Not used in steps in this document. |
mini="terms" (New) |
Multiple fields can be set as list. Terms are used in the RH side termsUsed section to set the required columns. Note: Reference only. Not used in steps in this document. |
The mini="list" attributes affect fields, repeatable fields, and repeatable groups of fields in cspace-config.xml.
Important Note
Right hand side bar and search results currently build their data lists in similar ways. Search results derived from the mini attribute can be displayed in the right hand side bar or in search result columns.
Prerequisites
All of the tasks required by this document can be performed by a system administrator with experience editing HTML and XML files.
Procedure App layer
The Application layer is arranged so that everything that is configurable is currently configurable using one file, cspace-config (Config location) The App layer controls what fields can be returned in the search results by using the cspace-config file. However, if you choose fields that the services layer is not returning in the list view then you search will be slower as the entire record for each item found will need to be accessed.
Procedure Search:
The procedure for changing the columns in the search results in the right sidebar is always the same: add a tag mini="search" to the field you wish to include in the results set. Review the code excerpts provided next to determine where the mini="xxx"
Loanin: (uses primary value of repeat field lender)
<repeat id="lenders" asSibling="true" xxx-services-no-repeat="yes"> <selector>.csc-loanIn-lender-row:</selector> <field id="lender" autocomplete="person-person,organization-organization" in-title="yes" mini="search"> <selector>.csc-loanIn-lender</selector> </field> </repeat>
If the summary field shown above in the Object example is referenced, object uses the title. However, if the title field is empty, it then uses objectName, as shown in the next example taken from the cspace-config.xml file:
<field id="nametitle" mini="search,list" exists-in-services="false"> <selector>.csc-object-identification-object-nametitle</selector> <merges> <merge id="title" rank="1"/> <merge id="objectName" rank="2"/> </merges> </field>
Test
Review your changes by running the search and determining if the new results are as expected.
Summary
The means for changing the columns in the search results in the right sidebar are always the same: add mini="search" to the field in cspace-config you want included in the search results.
Warning
You will need to activate your changes in cspace-config for the app to integrate them: unified collectionspace config#ActivatingyourchangesintheUI
See Also
For additional information, see the document cspace-config Fields