The TargetCategoriesPlugin retrieves the target categories assigned to the authenticated user's realm (organization/library) in the Torus.
Target categories are used to group search targets in order for the end user to restrict searches to given group(s) of targets.
Depending on the configuration, this plug-in can exclude empty categories, that is, categories without any targets assigned.
The request syntax would be ?command=categories.
Example:
/service-proxy/?command=categories
Response:
<categories realm="mk_demo"> <category> <categoryName>Subscription Databases</categoryName> <categoryId>id_subscription</categoryId> </category> <category> <categoryName>Open Access</categoryName> <categoryId>id_openaccess</categoryId> </category> <category> <categoryName>Library Catalogs</categoryName> <categoryId>id_lib</categoryId> </category> </categories>
The syntax for limiting search results to targets of a given category is:
/service-proxy/?command=search&query=water&filter=category=id_openaccess
This plug-in is configured in service-proxy.properties or equivalent as follows:
# The URL at which to find the categories. Mandatory. categories.TORUS_BASEURL = http://some-server/torus2/ # Can also be set to 'http://{thisHost}/torus/cat' if the Torus and the # Service Proxy share the same host. # The Torus URL to use when looking for targets assigned to a given category. # This property is mandatory when EXCLUDE_EMPTY_CATEGORIES is true # (which is the default). categories.TORUS_BASEURL_SEARCHABLE = http://some-server/torus2/ # Can also be set to 'http://{thisHost}/torus2/' if the Torus and the # Service Proxy share the same host.
# Determines whether a category without any targets assigned should be excluded categories.EXCLUDE_EMPTY_CATEGORIES = true # Optional: Default true categories.CACHE_CATEGORIES_ON_SESSION = true # Specifies if categories should # be looked up only once for the # duration of the HTTP session # Optional: Default true