Nextcloud PHP API (stable19)

ISearchTemplate

Class ISearchTemplate

This is a data transfer object that should be created by Content Provider when the getSearchTemplate() method is called.

The object will contain templates to be displayed, and the list of the different options to be available to the user when he start a new search.

The display of the Options is generated by the FullTextSearch app and Options can be displayed in 2 places:

  • the navigation page of the app that generate the indexed content. (files, bookmarks, deck, mails, ...)
  • the navigation page of the FullTextSearch app.

Both pages will have different Options, and only the first one can integrate a specific template.

Tags
see
IFullTextSearchProvider::getSearchTemplate
since
16.0.0

Table of Contents

addNavigationOption()  : ISearchTemplate
Add an option in the left panel of the FullTextSearch navigation page.
addPanelOption()  : ISearchTemplate
Add an option in the Panel that is displayed when the user start a search within the app that generate the content.
getCss()  : string
Get the path of the CSS file.
getIcon()  : string
Get the class of the icon.
getNavigationOptions()  : array
Get all options to be displayed in the FullTextSearch navigation page.
getPanelOptions()  : \OCP\FullTextSearch\Model\ISearchOption[]
Get all options to be displayed in the Panel.
getTemplate()  : string
Get the path of the template file.
setCss()  : ISearchTemplate
Set the path of a CSS file that will be loaded when needed.
setIcon()  : ISearchTemplate
Set the class of the icon to be displayed in the left panel of the FullTextSearch navigation page, in front of the related Content Provider.
setTemplate()  : ISearchTemplate
Set the path of the file of a template that the HTML will be displayed below the Options.

Methods

getCss()

Get the path of the CSS file.

public getCss() : string
Tags
since
16.0.0
Return values
string

getIcon()

Get the class of the icon.

public getIcon() : string
Tags
since
16.0.0
Return values
string

getNavigationOptions()

Get all options to be displayed in the FullTextSearch navigation page.

public getNavigationOptions() : array
Tags
since
16.0.0
Return values
array

getPanelOptions()

Get all options to be displayed in the Panel.

public getPanelOptions() : \OCP\FullTextSearch\Model\ISearchOption[]
Tags
since
16.0.0
Return values
\OCP\FullTextSearch\Model\ISearchOption[]

getTemplate()

Get the path of the template file.

public getTemplate() : string
Tags
since
16.0.0
Return values
string

setIcon()

Set the class of the icon to be displayed in the left panel of the FullTextSearch navigation page, in front of the related Content Provider.

public setIcon(string $class) : ISearchTemplate
Parameters
$class : string
Tags
since
16.0.0
Return values
ISearchTemplate

setTemplate()

Set the path of the file of a template that the HTML will be displayed below the Options.

public setTemplate(string $template) : ISearchTemplate

This should only be used if your Content Provider needs to set options in a way not generated by FullTextSearch

Parameters
$template : string
Tags
since
16.0.0
Return values
ISearchTemplate

Search results