Defining Look-up Services
Data source query forms may contain a special type of field called a
look-up
field. A look-up field is one where the
user can select a value by typing: as the user types, a list of
matching options is displayed, from which the user can pick the
required option. The look-up operations that provide this kind of
functionality are performed by web services. A number of look-up
services are included with the Widget Framework, and you can also
create your own look-up services if required (see
Creating Your Own Look-up Service).
The built-in look-up services provided with the
Widget Framework
are listed in a configuration layer component called
/com/escenic/framework/webservice/LookupSources
as
follows:
$class=com.escenic.framework.webservice.helper.LookupSources lookupService.group-names=/webservice/escenic/wf/collection/groups/search/ lookupService.content-types=/webservice/escenic/wf/collection/content-types/search/ lookupService.relation-groups=/webservice/escenic/wf/collection/relation-groups/search/ lookupService.tags=/webservice/escenic/wf/collection/tags/search/{term} entryService.tags=/webservice/escenic/wf/collection/tags/name/{value} lookupService.sections=/webservice/escenic/wf/collection/sections/search/{term} entryService.sections=/webservice/escenic/wf/collection/sections/name/{section}?publication={publication}
These services are used by the default data source query types, but you can also use them in your own queries:
group-names
-
This service returns information about all section page groups in all publications. Groups that appear in templates are not included.
content-types
-
This service returns information about all content types in all publications.
relation-groups
-
This service returns information about all relation type groups in all publications.
tags
-
This service returns information about tags from all tag structures.
sections
-
This service returns information about sections. It is used by the data source query section component (that is
<component name="section"/>)
in a query definition file.
If these services are insufficient and you need to create a look-up service of your own, then you can do so. For more about creating your own look-up service, see Creating Your Own Look-up Service.
To register your own look-up service with the
Widget Framework,
open
configuration-root/com/escenic/framework/webservice/LookupSources.properties
(or create it if it does not exist), and add a definition that looks
like one of the following:
-
lookupService.service-name=service-url/search/
-
lookupService.service-name=service-url/search/{term} entryService.service-name=service-url/name/{value}
In both kinds of definition, service-name is the name that you will use to refer to the service in your query type configuration file and service-url is the URL of your service. Which kind of definition you should use depends on what kind of look-up service you have created. For further information, see Creating Your Own Look-up Service.