Skip to content

Instantly share code, notes, and snippets.

@eedeebee
Created January 14, 2011 01:42
Show Gist options
  • Select an option

  • Save eedeebee/778998 to your computer and use it in GitHub Desktop.

Select an option

Save eedeebee/778998 to your computer and use it in GitHub Desktop.
Snippet #1 in Adding Maps to an AppBuilder application
declare function app:get-content()
{
let $view := $config:CONTEXT/*:view
return
if ($view eq "search")
then (
xdmp:apply($config:toolbar),
if (data($config:RESPONSE/@total) eq 0)
then xdmp:apply($config:error-message,
concat("Your search for ",$config:CONTEXT/*:q,
" did not match anything. Make sure all words are spelled correctly or try different keywords."))
else (
xdmp:apply($config:result-navigation),
xdmp:apply($config:results),
xdmp:apply($config:result-navigation)))
else if ($view eq "detail")
then (
xdmp:apply($config:toolbar),
xdmp:apply($config:item-render) )
else if ($view eq "terms")
then xdmp:apply($config:terms)
else if ($view eq "help")
then xdmp:apply($config:help)
else if ($view eq "contact")
then xdmp:apply($config:contact)
else if ($view eq "intro") then
<div id="map" style="width:100%; height:300px"/>
else xdmp:apply($config:browse)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment