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#2

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
$server-uri
Returns:
xs:string

apputil:deploy-upload#4

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
$repo-path
$file-name
$server-uri
Returns:
xs:string

apputil:get-resource#2

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:
$appthe unique name of the application
$path
Returns:
document-node()?

apputil:install-from-repo#3

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

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

apputil:install-from-repo#4

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:
$nameunique name of the package to install (optional)
$package-paththe file name of the package to install (optional)
$server-urithe URI of the public-repo app on the server
$version
Returns:
item()* : the empty sequence

apputil:is-installed#2

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:
$pkgURIunique name of the application
$version
Returns:
element()?

apputil:remove#1

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

Remove the package identified by its unique name.

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

apputil:resolve#1

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
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#1

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
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#1

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:
$callbackthe callback function to call for every package found
Returns:
item()*

apputil:store-upload#0

apputil:store-upload() as element()

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

Returns:
element()

apputil:upload#1

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

Parameters:
$server-uri
Returns:
xs:string