Connect to Fusion from App Studio

The most important tags in every page template are the first three, which configure how App Studio connects to Fusion:

  • Define which provider to use (the search:platform).

  • Create a query from the URL, or any parameters you explicitly declare (the search:query).

  • Send the query to the platform and obtain a response (the search:response).

Below is an example from the default template (located at app/views/search.html for version 4.0):

<search:platform var="platform" conf="platforms.fusion.data"></search:platform>
<search:query var="query" parameters="*" results-per-page="12"></search:query>
<search:response var="response" platform="platform" query="query">
    <widget:spinner></widget:spinner>
</search:response>

The search:platform tag

The search:platform tag specifies the endpoint where App Studio obtains its data, pointing to a specific platform configuration endpoint.

See search:query for additional available parameters.

In this case we declare a data provider (platform) for a particular Fusion collection and set of parameters to search through an index.

<search:platform var="platform" conf="platforms.fusion.data"></search:platform>

See search:platform for additional available parameters.

The search:query tag

The search:query tag constructs an App Studio query object. You can choose to build a query from scratch by passing in the parameters you want or you can have it automatically created from the page URL.

Here’s how you build a query using all query string parameters, and default to 12 results per page:

<search:query var="query" parameters="*" results-per-page="12"></search:query>

If you didn’t want the user to be able to specify results per page you would simply omit that parameter when building a query from the URL:

<search:query var="query" parameters='*,-rpp' results-per-page="12"></search:query>

See search:query for additional available parameters.

The search:response tag

The search:response tag brings the platform and the query together.

In the example below we refer to the previously-defined platform and query by variable name:

<search:response var="response" platform="platform" query="query">
    <widget:spinner></widget:spinner>
</search:response>

See search:response for additional available parameters.