Item advanced search results portlet

From VYRE

Jump to: navigation, search
Item advanced search results portlet
module: Content module
supplier: VYRE Ltd.
Since Unify 4.4


Contents

Usage

The Advanced item search results portlet is used to display items from one or more stores in a similar way to the Item - search results portlet. It extends a lot of the features already available in the Item - search results portlet, but does not replicate them all.

Once the portlet is configured correctly it will returned XML representing a list of items. This XML is then transformed into what the user see using the XSL stylesheet defined in the configuration of the portlet.

Configuration

The configuration of the portlet is split into three tabs within the edit mode.

Search settings

Stylesheet

  • XSL Style Sheet: select which style sheet to use to display the list of items returned. This option uses shortcut functionality.

Global XML configuration

  • Global XML configuration: allows to customize the XML output via relevant entity. This functionality was introduced in Unify 4.6. If you are using a previous version this feature will not be available.

Search mode

  • Use incoming search query uses a search query sent from an Item search portlet or Template search input portlet to decide which items are returned.
  • Use a saved search: select a save search to generate the list of items that are returned. You can combine this with an incoming search query (for example, you might create a saved search to return all published news items within certain embargo or expiry dates, and use an incoming search query to allow the user to search only published stories. This option uses shortcut functionality.
  • List all items from a store lists all active items from a file or data store. This option uses shortcut functionality.
  • Detect incoming item allows to form search results depending on item ID passed via URL. If the item with given id does not exist or the user does not have enough permissions to view it, search results will be empty. This feature is only available from Unify 4.6.

Configure Results (search results tree)


This allows you to define exactly what is returned in the XML of the search results. This includes which items links are returned and what data is included at each level of the XML.

There are two ways to configure this; through an XML configuration document, or by the use of a GUI. It is highly recommended to use the GUI, since it does everything that can be done in the XML configuration but eliminates the possibility of any mistakes. The only real use of the XML configuration is to copy and paste the configuration between portlets. Switching between the two modes is a simple case of clicking the visual and XML buttons on the Configure results box.

The first thing that you will need to do is choose a collection schema. All the collection schemas it is possible to have results from will be displayed in the collection schema drop down box. This list is filtered by the search mode the portlet is using. For example, if the search mode is "use incoming query", it is possible to choose from all stores, but if the search mode is set to "List all items from a store", it will only be possible to choose from that store.

Once a collection schema is chosen and the add button pressed, the name of the schema will appear in the box below. Here it is possible to choose exactly what XML is returned when an Item from that collection schema appears in the results. These options are shown below.

It is also possible to choose which links (both user links and item links) are returned in the XML. Pressing the plus button next to the name of the collection schema will bring up the add links menu. This contains a list of all links from that collection schema grouped by file store, data store and user links. Clicking on one of these links will make that link appear under the name of the collection schema. This means that that particular link will be returned within the results of the portlet. It is then possible to choose what information is returned at the other end of the link. It is also possible to choose another link which should be returned in the results from this level.

XML options
Stores
Option XPath Notes
Load content /search-results/items/data-item/content Whether the content of an item should be loaded. Only relevant for data stores.
Load metadata /search-results/items/{data|file}-item/metadata Whether the metadata of an item should be loaded.
Load taxonomy /search-results/items/{data|file}-item/categories;
/search-results/items/{data|file}-item/taxonomy
Whether the taxonomy of an item should be loaded. Shows flat and nested taxonomy blocks, correspondingly.
Load derived files /search-results/items/file-item/derived-files Whether the derived files of an item should be loaded. Only relevant for file stores.
Load original file /search-results/items/file-item/original-file Whether the original file of an item should be loaded. Only relevant for file stores.
Load creator profile picture /search-results/items/{data|file}-item/creator/user-profile-picture Whether the User profile picture XML block for the creator should be displayed.
Load modifier profile picture /search-results/items/{data|file}-item/last-modifier/user-profile-picture Whether the User profile picture XML block for the item last modifier should be displayed.

NOTE: XPaths given above represent the top level of generated XML. If your configuration is nested (via item links as explained above), XPaths will have corresponding nested structure.

Realms
Option XPath Notes
Load Properties /search-results/items/{file|data}-item/user-links/user-link/users/user/properties Whether the profile properties of users should be displayed.
Load Profile Picture /search-results/items/{file|data}-item/user-links/user-link/users/user/user-profile-picture Whether User profile picture XML block should be displayed.

NOTE: XPaths given above are the result when top level schema is associated with some user link. This is not the only possible scenario. For example, users can also be displayed as a result of following configuration chain: Collection schema CS1 -> item link IL1 -> Collection Schema CS2 -> User link UL1. In such (and similar) cases, XPaths will have corresponding nested structures.

Use Locale Filtering

If this is turned on, you will have the choice of what locale the search results will be in. This means that when you choose a locale, all items returned by the results will be in that particular locale. Also, the render locale of the search request will be set to that locale. This will only have any affect on the search results if the search query is using the dynamic variable $renderLocale.

When this is turned off, the items returned by the search will not be restricted to items in a particular locale and the render locale of the search results will be the same as the render locale of the page.

Sorting

Configuring the sorting options allows you to choose the order that items are returned in the portlet. You may choose one or two sort fields, though by default only one is selected. The sort fields it is possible to choose from are Score, Name, Creation date, Modification date,View count and Order count(Number of times an item has been ordered through the ecommerce module). If the search settings are configured so that all results are from the same store, any sortable attributes from that store are also added to the list of possible sort fields.

If the sort by locale option is chosen, all results will be ordered according to that locale, otherwise the locale that the page is rendered in will be used.

Pagination

Template:Rellink


Content Export

Allows the user to export the results via a url get request. For example, http://site.com/url/?exportId=1&export-filename=asset_report.xls&export-title=Asset%20Report&export-description=exported%20by%20Eff%20Miah

Users can specify the configuration as a query parameter:

  • exportId - content export configuration id
  • export-filename - filename of the export
  • export-name - title of an excel export
  • export-description - description of an excel export, this normally appears in the second row of the excel document

Differences with the Item - search results portlet

This portlet does a very similar job to the Item - search results portlet, but there are some differences. In Unify 4.4, there are a number of things which can be done in the Item - search results portlet but cannot be done in this portlet. It is planned that in future versions of Unify everything that can be done in the Item - search results portlet will be replicated in this portlet. If your requirements can be meet by both portlets, it is recommended to use this portlet. Although setup time for this portlet is normally greater, it will almost always result in a faster response time.

Feature Item search results Advanced Item search results Notes
Link definition filtering Yes No Rarely used in Item search results
Profile Group filtering Yes No Rarely used in Item search results
Item Attribute to user property filtering Yes No Rarely used in Item search results
Load version history Yes No Not implemented in Advanced portlet yet. Will be added in a future release.
Load Item lists Yes No Not implemented in Advanced portlet yet. Will be added in a future release.
Export configurations Yes No Not implemented in Advanced portlet yet. Will be added in a future release.
Choose which links to display No Yes Within the Item search results portlet, you can either return item/users links or not. This means that if you are only interested in one or two link definitions, you still need to return all of them slowing down the response. In the advanced portlet, you can pick and choose which links should be returned, meaning that time is not unnecessarily spent doing work which is is not needed.
Display deep links No Yes Another major advantage of the Advanced portlet. In the Item search results portlet, it is only ever possible to return links one level deep. In the advanced portlet, you can decide exactly how deep to go and which links should be displayed.
Define better what data to return No Yes The Item search results portlet allows you to "return content/metadata of items". In the advanced portlet, these are split up so that unnecessary data is no longer returned. You can now set different option for different stores.

Query parse error handling

This functionality was introduced in Unify 4.6. If you are using a previous version this feature will not be available.

A new field has been added to the output xml, so when an invalid query is introduced the xml will contain a field called <queryParseError> where the exception message will be. It will be an empty search results, where we will find our search parameters, and in the <search-term> field we will be able to retrieve the original query.

<xml version="1.0" encoding="UTF-8">
<search-results>
	<size>0</size>
	<start-index>1</start-index>
	<end-index>1</end-index>
	<page-no>1</page-no>
	<no-of-pages>1</no-of-pages>
	<items-per-page>0</items-per-page>
	<forward>
		<action>/vyre4/pub_module/pageview528_2?portal:componentId=807&amp;portal:type=action&amp;portal:isSecure=false&amp;portal:portletMode=view</action>
	</forward>
	<action-path>/vyre4/pub_module/pageview528_2?portal:componentId=807&amp;portal:type=action&amp;portal:isSecure=false&amp;portal:portletMode=view</action-path>
	<queryParseError>For input string: "2555-63-15"</queryParseError>
	<action-extensions>
		<add-to-basket>
			<order>&amp;addToBasket=order</order>
			<bulk-edit>&amp;addToBasket=bulkEdit</bulk-edit>
		</add-to-basket>
		<sortable-attributes>
			<score>&amp;sortBy=score</score>
			<name>&amp;sortBy=sort_name</name>
			<creationDate>&amp;sortBy=sort_creationDate_t</creationDate>
			<lastModifiedDate>&amp;sortBy=sort_lastModifiedDate_t</lastModifiedDate>
			<viewCount>&amp;sortBy=viewCount</viewCount>
			<orderCount>&amp;sortBy=orderCount</orderCount>
			<ratingAverage>&amp;sortBy=ratingAverage</ratingAverage>
		</sortable-attributes>
		<sort-directions>
			<asc>&amp;orderBy=ascending</asc>
			<desc>&amp;orderBy=descending</desc>
		</sort-directions>
		<items-per-page>&amp;itemsPerPage=</items-per-page>
		<do-redirect>&amp;doRedirect=</do-redirect>
		<page-no>&amp;pageNo=</page-no>
		<export-id>&amp;exportId=</export-id>
		<previous-actions/>
	</action-extensions>
	<search-term>creationDate:'2555-63-15'</search-term>
	<sorting>
		<first-sort-field>score</first-sort-field>
		<first-sort-field-direction>ascending</first-sort-field-direction>
	</sorting>
	<items/>
</search-results>


See Also

Item - Search Results portlet

Personal tools