Difference between revisions of "Repository Module"

From BaseX Documentation
Jump to navigation Jump to search
Line 3: Line 3:
 
=Conventions=
 
=Conventions=
  
All functions in this module are assigned to the <code>http://basex.org/modules/repo</code> namespace, which is statically bound to the <code>repo</code> prefix.<br/>
+
All functions in this module are assigned to the {{Code|http://basex.org/modules/repo}} namespace, which is statically bound to the {{Code|repo}} prefix.<br/>
All errors are assigned to the <code>http://basex.org/errors</code> namespace, which is statically bound to the <code>bxerr</code> prefix.
+
All errors are assigned to the {{Code|http://basex.org/errors}} namespace, which is statically bound to the {{Code|bxerr}} prefix.
  
 
=Functions=
 
=Functions=
Line 12: Line 12:
 
|-
 
|-
 
| width='90' | '''Signatures'''
 
| width='90' | '''Signatures'''
|<code><b>repo:install</b>($path as xs:string) as empty-sequence()</code><br />
+
|{{Func|repo:install|$path as xs:string|empty-sequence()}}<br />
 
|-
 
|-
 
| '''Summary'''
 
| '''Summary'''
|Installs a package, or (since {{Version|7.2.1}}), replaces an existing package. The parameter <code>$path</code> indicates the path to the package.<br />
+
|Installs a package, or (since {{Version|7.2.1}}), replaces an existing package. The parameter {{Code|$path}} indicates the path to the package.<br />
 
|-
 
|-
 
| '''Errors'''
 
| '''Errors'''
|<b>[[XQuery Errors#Packaging Errors|BXRE0001]]</b> is raised if the package does not exist.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0002]]</b> is raised if a package uses an invalid namespace URI.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0003]]</b> is raised if the package to be installed requires a package which is still not installed.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0004]]</b> is raised if the package descriptor is invalid.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0005]]</b> is raised if the module contained in the package to be installed is already installed as part of another package.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0006]]</b> is raised if the package cannot be parsed.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0009]]</b> is raised if the package version is not supported.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0010]]</b> is raised if the package contains an invalid JAR descriptor.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0011]]</b> is raised if the package contains a JAR descriptor but it cannot be read.<br />
+
|{{Error|BXRE0001|XQuery Errors#Packaging Errors}} the package does not exist.<br />{{Error|BXRE0002|XQuery Errors#Packaging Errors}} a package uses an invalid namespace URI.<br />{{Error|BXRE0003|XQuery Errors#Packaging Errors}} the package to be installed requires a package which is still not installed.<br />{{Error|BXRE0004|XQuery Errors#Packaging Errors}} the package descriptor is invalid.<br />{{Error|BXRE0005|XQuery Errors#Packaging Errors}} the module contained in the package to be installed is already installed as part of another package.<br />{{Error|BXRE0006|XQuery Errors#Packaging Errors}} the package cannot be parsed.<br />{{Error|BXRE0009|XQuery Errors#Packaging Errors}} the package version is not supported.<br />{{Error|BXRE0010|XQuery Errors#Packaging Errors}} the package contains an invalid JAR descriptor.<br />{{Error|BXRE0011|XQuery Errors#Packaging Errors}} the package contains a JAR descriptor but it cannot be read.<br />
 
|}
 
|}
  
Line 25: Line 25:
 
|-
 
|-
 
| width='90' | '''Signatures'''
 
| width='90' | '''Signatures'''
|<code><b>repo:delete</b>($pkg as xs:string) as empty-sequence()</code><br />
+
|{{Func|repo:delete|$pkg as xs:string|empty-sequence()}}<br />
 
|-
 
|-
 
| '''Summary'''
 
| '''Summary'''
|Deletes a package. The parameter <code>$pkg</code> indicates either the package name as specified in the package descriptor or (since {{Version|7.2.1}}) the name, suffixed with a hyphen and the package version.<br />
+
|Deletes a package. The parameter {{Code|$pkg}} indicates either the package name as specified in the package descriptor or (since {{Version|7.2.1}}) the name, suffixed with a hyphen and the package version.<br />
 
|-
 
|-
 
| '''Errors'''
 
| '''Errors'''
|<b>[[XQuery Errors#Packaging Errors|BXRE0007]]</b> is raised if the package cannot be deleted.<br /><b>[[XQuery Errors#Packaging Errors|BXRE0008]]</b> is raised if another package depends on the package to be deleted.<br />
+
|{{Error|BXRE0007|XQuery Errors#Packaging Errors}} the package cannot be deleted.<br />{{Error|BXRE0008|XQuery Errors#Packaging Errors}} another package depends on the package to be deleted.<br />
 
|}
 
|}
  
Line 41: Line 41:
 
|-
 
|-
 
| width='90' | '''Signatures'''
 
| width='90' | '''Signatures'''
|<code><b>repo:list</b>() as element(package)*</code><br />
+
|{{Func|repo:list||element(package)*}}<br />
 
|-
 
|-
 
| '''Summary'''
 
| '''Summary'''
Line 53: Line 53:
 
! width="95%"|Description
 
! width="95%"|Description
 
|-
 
|-
|<code>BXRE0001</code>
+
|{{Code|BXRE0001}}
 
|The addressed package does not exist.
 
|The addressed package does not exist.
 
|-
 
|-
|<code>BXRE0002</code>
+
|{{Code|BXRE0002}}
 
|A package uses an invalid namespace URI.
 
|A package uses an invalid namespace URI.
 
|-
 
|-
|<code>BXRE0003</code>
+
|{{Code|BXRE0003}}
 
|The package to be installed requires a package which is not installed yet.
 
|The package to be installed requires a package which is not installed yet.
 
|-
 
|-
|<code>BXRE0004</code>
+
|{{Code|BXRE0004}}
 
|The package descriptor is invalid.
 
|The package descriptor is invalid.
 
|-
 
|-
|<code>BXRE0005</code>
+
|{{Code|BXRE0005}}
 
|The module contained in the package to be installed is already installed as part of another package.
 
|The module contained in the package to be installed is already installed as part of another package.
 
|-
 
|-
|<code>BXRE0006</code>
+
|{{Code|BXRE0006}}
 
|The package cannot be parsed.
 
|The package cannot be parsed.
 
|-
 
|-
|<code>BXRE0009</code>
+
|{{Code|BXRE0007}}
 +
|The package cannot be deleted.
 +
|-
 +
|{{Code|BXRE0008}}
 +
|Another package depends on the package to be deleted
 +
|-
 +
|{{Code|BXRE0009}}
 
|The package version is not supported.
 
|The package version is not supported.
 
|-
 
|-
|<code>BXRE0010</code>
+
|{{Code|BXRE0010}}
 
|The package contains an invalid JAR descriptor.
 
|The package contains an invalid JAR descriptor.
 
|-
 
|-
|<code>BXRE0011</code>
+
|{{Code|BXRE0011}}
 
|The package contains a JAR descriptor but it cannot be read.
 
|The package contains a JAR descriptor but it cannot be read.
 
|}
 
|}

Revision as of 15:15, 26 May 2012

This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository.

Conventions

All functions in this module are assigned to the http://basex.org/modules/repo namespace, which is statically bound to the repo prefix.
All errors are assigned to the http://basex.org/errors namespace, which is statically bound to the bxerr prefix.

Functions

repo:install

Signatures repo:install($path as xs:string) as empty-sequence()
Summary Installs a package, or (since Version 7.2.1), replaces an existing package. The parameter $path indicates the path to the package.
Errors BXRE0001: the package does not exist.
BXRE0002: a package uses an invalid namespace URI.
BXRE0003: the package to be installed requires a package which is still not installed.
BXRE0004: the package descriptor is invalid.
BXRE0005: the module contained in the package to be installed is already installed as part of another package.
BXRE0006: the package cannot be parsed.
BXRE0009: the package version is not supported.
BXRE0010: the package contains an invalid JAR descriptor.
BXRE0011: the package contains a JAR descriptor but it cannot be read.

repo:delete

Signatures repo:delete($pkg as xs:string) as empty-sequence()
Summary Deletes a package. The parameter $pkg indicates either the package name as specified in the package descriptor or (since Version 7.2.1) the name, suffixed with a hyphen and the package version.
Errors BXRE0007: the package cannot be deleted.
BXRE0008: another package depends on the package to be deleted.

repo:list

Template:Mark

Signatures repo:list() as element(package)*
Summary Lists the names and versions of all currently installed packages.

Errors

Code Description
BXRE0001 The addressed package does not exist.
BXRE0002 A package uses an invalid namespace URI.
BXRE0003 The package to be installed requires a package which is not installed yet.
BXRE0004 The package descriptor is invalid.
BXRE0005 The module contained in the package to be installed is already installed as part of another package.
BXRE0006 The package cannot be parsed.
BXRE0007 The package cannot be deleted.
BXRE0008 Another package depends on the package to be deleted
BXRE0009 The package version is not supported.
BXRE0010 The package contains an invalid JAR descriptor.
BXRE0011 The package contains a JAR descriptor but it cannot be read.

Changelog

Version 7.2.1

  • Updated: repo:install: existing packages will be replaced
  • Updated: repo:delete: remove specific version of a package

Version 7.2

The module was introduced with Version 7.1.