XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/apps

/db/apps/shared-resources/content/apputil.xql

Utility functions to find, install, upload and remove packages from the package repository.

apputil:deploy-upload

apputil:deploy-upload($pkg-metadata as element(), $server-uri as xs:anyURI) as xs:string

Deploys an uploaded XAR to the database.

Parameters:
$pkg-metadata $pkg-metadata
$server-uri $server-uri
Returns:
xs:string

apputil:deploy-upload

apputil:deploy-upload($package as xs:string, $repo-path as xs:string, $file-name as xs:string, $server-uri as xs:anyURI) as xs:string

Deploys an uploaded XAR to the database.

Parameters:
$package $package
$repo-path $repo-path
$file-name $file-name
$server-uri $server-uri
Returns:
xs:string

apputil:get-resource

apputil:get-resource($app as xs:string, $path as xs:string) as document-node()?

Retrieve an XML resource from the application package identified by the unique name given in the first parameter. The resource is parsed an returned as an XML document node.

Parameters:
$app the unique name of the application
$path $path
Returns:
document-node()?

apputil:install-from-repo

apputil:install-from-repo($name as xs:string?, $package-path as xs:anyURI?, $server-uri as xs:anyURI) as item()*

Parameters:
$name? $name?
$package-path? $package-path?
$server-uri $server-uri
Returns:
item()*

apputil:install-from-repo

apputil:install-from-repo($name as xs:string?, $package-path as xs:anyURI?, $server-uri as xs:anyURI, $version as xs:string?) as item()*

Install a package from the public repository. The package is either specified by its unique name in the first parameter or its file name, e.g. "dashboard-0.1.xar".

Parameters:
$name? unique name of the package to install (optional)
$package-path? the file name of the package to install (optional)
$server-uri the URI of the public-repo app on the server
$version? $version?
Returns:
item()* : the empty sequence

apputil:is-installed

apputil:is-installed($pkgURI as xs:anyURI, $version as xs:string?) as element()?

Check if the application identified by the given unique name is installed. Returns the package descriptor of the application if found or the empty sequence otherwise.

Parameters:
$pkgURI unique name of the application
$version? $version?
Returns:
element()?

apputil:remove

apputil:remove($package-url as xs:string) as xs:boolean

Remove the package identified by its unique name.

Parameters:
$package-url $package-url
Returns:
xs:boolean : true if the package could be removed, false otherwise

apputil:resolve

apputil:resolve($uri as xs:string) as xs:string?

Try to find an application by its unique name and return the relative path to which it has been deployed inside the database.

Parameters:
$uri $uri
Returns:
xs:string? : database path relative to the collection returned by repo:get-root() or the empty sequence if the package could not be found or is not deployed into the db

apputil:resolve-abbrev

apputil:resolve-abbrev($abbrev as xs:string) as xs:string?

Try to find an application by its abbreviated name and return the relative path to which it has been deployed inside the database.

Parameters:
$abbrev $abbrev
Returns:
xs:string? : database path relative to the collection returned by repo:get-root() or the empty sequence if the package could not be found or is not deployed into the db

apputil:scan-repo

apputil:scan-repo($callback as function(*)) as item()*

Scan all installed application and library packages. Calls the provided callback function once for every package, passing the package URI as first parameter, the expath pkg descriptor XML as second, and the repo.xml descriptor as third.

Parameters:
$callback the callback function to call for every package found
Returns:
item()*

apputil:store-upload

apputil:store-upload() as element()

Stores an uploaded XAR to the repo, and returns the metadata.

Returns:
element()

apputil:upload

apputil:upload($server-uri as xs:anyURI) as xs:string

Parameters:
$server-uri $server-uri
Returns:
xs:string