SearchTemplate

class OC\FullTextSearch\Model\SearchTemplate
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.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#59
Implements:OCP\FullTextSearch\Model\ISearchTemplate JsonSerializable

Properties

Methods

public OC\FullTextSearch\Model\SearchTemplate::__construct($icon="", $css="")
ISearchTemplate constructor.
the class of the icon and the css file to be loaded can be set during the
creation of the object.
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#89

Parameters:
  • $icon (string)
  • $css (string)
Since:

15.0.0

public OC\FullTextSearch\Model\SearchTemplate::setIcon($class)
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.
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#105

Parameters:
  • $class (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchTemplate

public OC\FullTextSearch\Model\SearchTemplate::getIcon()
Get the class of the icon.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#118
Since:15.0.0
Returns:string
public OC\FullTextSearch\Model\SearchTemplate::setCss($css)
Set the path of a CSS file that will be loaded when needed.
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#132

Parameters:
  • $css (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchTemplate

public OC\FullTextSearch\Model\SearchTemplate::getCss()
Get the path of the CSS file.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#145
Since:15.0.0
Returns:string
public OC\FullTextSearch\Model\SearchTemplate::setTemplate($template)
Set the path of the file of a template that the HTML will be displayed
below the Options.
This should only be used if your Content Provider needs to set options in
a way not generated by FullTextSearch
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#162

Parameters:
  • $template (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchTemplate

public OC\FullTextSearch\Model\SearchTemplate::getTemplate()
Get the path of the template file.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#175
Since:15.0.0
Returns:string
public OC\FullTextSearch\Model\SearchTemplate::addPanelOption($option)
Add an option in the Panel that is displayed when the user start a search
within the app that generate the content.
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#192

Parameters:
See:

\OCP\FullTextSearch\Model\ISearchOption

Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchTemplate

public OC\FullTextSearch\Model\SearchTemplate::getPanelOptions()
Get all options to be displayed in the Panel.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#205
Since:15.0.0
Returns:\OC\FullTextSearch\Model\SearchOption[]
public OC\FullTextSearch\Model\SearchTemplate::addNavigationOption($option)
Add an option in the left panel of the FullTextSearch navigation page.
Source:

lib/private/FullTextSearch/Model/SearchTemplate.php#221

Parameters:
See:

\OCP\FullTextSearch\Model\ISearchOption

Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchTemplate

public OC\FullTextSearch\Model\SearchTemplate::getNavigationOptions()
Get all options to be displayed in the FullTextSearch navigation page.
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#234
Since:15.0.0
Returns:array
public OC\FullTextSearch\Model\SearchTemplate::jsonSerialize()
Source:lib/private/FullTextSearch/Model/SearchTemplate.php#244
Since:15.0.0
Returns:array