|
24 | 24 | <title>Introduction</title>
|
25 | 25 |
|
26 | 26 | <para>The package repository is based on and extends the <link condition="_blank"
|
27 |
| - xlink:href="http://expath.org/modules/pkg/">EXPath Packaging System</link>. The core of |
28 |
| - the EXPath packaging specification has been designed to work across different XQuery |
| 27 | + xlink:href="http://expath.org/modules/pkg/">EXPath Packaging System</link>. The core |
| 28 | + of the EXPath packaging specification has been designed to work across different XQuery |
29 | 29 | implementations and is targeted at managing extension libraries (including XQuery, Java
|
30 | 30 | or XSLT code modules). eXist-db extends this core by adding a facility for the automatic
|
31 | 31 | deployment of entire applications into the database. </para>
|
|
73 | 73 | directory: <literal>expath-pkg.xml</literal> and <literal>repo.xml</literal>:</para>
|
74 | 74 | <variablelist>
|
75 | 75 | <varlistentry>
|
76 |
| - <term> <literal>expath-pkg.xml</literal> </term> |
| 76 | + <term> |
| 77 | + <literal>expath-pkg.xml</literal> |
| 78 | + </term> |
77 | 79 | <listitem>
|
78 | 80 | <para>This is the standard EXPath descriptor as defined by the EXPath
|
79 | 81 | specification. It specifies the unique name of the package, lists
|
80 | 82 | dependencies and any library modules to register globally. See <xref
|
81 |
| - linkend="sect-expathpkg"/>.</para> |
| 83 | + linkend="sect-expathpkg"/>.</para> |
82 | 84 | </listitem>
|
83 | 85 | </varlistentry>
|
84 | 86 | <varlistentry>
|
85 |
| - <term> <literal>repo.xml</literal> </term> |
| 87 | + <term> |
| 88 | + <literal>repo.xml</literal> |
| 89 | + </term> |
86 | 90 | <listitem>
|
87 | 91 | <para>The eXist-db specific deployment descriptor: it contains additional
|
88 | 92 | metadata about the package and controls how it will be deployed into the
|
|
92 | 96 | </variablelist>
|
93 | 97 | <para>For library packages <literal>repo.xml</literal> is optional. However, we recommend to
|
94 | 98 | always provide it for better tool integration.</para>
|
| 99 | + <para>The following is not mentioned in the EXPath spec, but if an image resource with the |
| 100 | + filename <literal>icon.png</literal> or <literal>icon.svg</literal> is found in the root |
| 101 | + directory of an app, the eXist-db dashboard will display that user-supplied image |
| 102 | + instead of the default eXist-db blue dotted <literal>X</literal>.</para> |
95 | 103 |
|
96 | 104 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
97 | 105 |
|
|
154 | 162 | <code>expath-pkg.xml</code> descriptor. For eaxample:</para>
|
155 | 163 | <programlisting language="xml" xlink:href="listings/listing-2.xml"/>
|
156 | 164 | <para>It is also possible to create a dependency on a specific version, based on
|
157 |
| - <link condition="_blank" xlink:href="https://semver.org/">Semantic |
158 |
| - Versioning</link>. This can be done by adding either of the attributes: |
| 165 | + <link condition="_blank" xlink:href="https://semver.org/">Semantic |
| 166 | + Versioning</link>. This can be done by adding either of the attributes: |
159 | 167 | <code>version</code>, <code>semver</code>, <code>semver-min</code>,
|
160 | 168 | <code>semver-max</code>: </para>
|
161 | 169 | <variablelist>
|
|
189 | 197 | <varlistentry>
|
190 | 198 | <term><code>semver-max</code></term>
|
191 | 199 | <listitem>
|
192 |
| - <para>Defines a maximum version according to the |
193 |
| - <code>semver</code> scheme.</para> |
| 200 | + <para>Defines a maximum version according to the <code>semver</code> |
| 201 | + scheme.</para> |
194 | 202 | </listitem>
|
195 | 203 | </varlistentry>
|
196 | 204 | </variablelist>
|
|
216 | 224 | and may be used by other packages without knowing where the module code is
|
217 | 225 | stored. </para>
|
218 | 226 | <para>For example, the following descriptor registers the module
|
219 |
| - <literal>functx.xql</literal> using the given namespace: </para> |
| 227 | + <literal>functx.xql</literal> using the given namespace: </para> |
220 | 228 | <programlisting language="xml" xlink:href="listings/listing-4.xml"/>
|
221 | 229 | <para>The namespace has to correspond to the namespace defined in the module
|
222 | 230 | declaration of the XQuery module. The file should be placed into a subdirectory
|
|
282 | 290 | <colspec colwidth="33%"/>
|
283 | 291 | <thead>
|
284 | 292 | <row>
|
285 |
| - <entry> <para>Type of package</para> </entry> |
286 |
| - <entry> <para>type</para> </entry> |
287 |
| - <entry> <para>target</para> </entry> |
| 293 | + <entry> |
| 294 | + <para>Type of package</para> |
| 295 | + </entry> |
| 296 | + <entry> |
| 297 | + <para>type</para> |
| 298 | + </entry> |
| 299 | + <entry> |
| 300 | + <para>target</para> |
| 301 | + </entry> |
288 | 302 | </row>
|
289 | 303 | </thead>
|
290 | 304 | <tbody>
|
291 | 305 | <row>
|
292 |
| - <entry> <para>Application package</para> </entry> |
293 |
| - <entry> <para><code>application</code></para> </entry> |
294 |
| - <entry> <para>specified</para> </entry> |
| 306 | + <entry> |
| 307 | + <para>Application package</para> |
| 308 | + </entry> |
| 309 | + <entry> |
| 310 | + <para><code>application</code></para> |
| 311 | + </entry> |
| 312 | + <entry> |
| 313 | + <para>specified</para> |
| 314 | + </entry> |
295 | 315 | </row>
|
296 | 316 | <row>
|
297 |
| - <entry> <para>Resource package</para> </entry> |
298 |
| - <entry> <para><code>library</code></para> </entry> |
299 |
| - <entry> <para>specified</para> </entry> |
| 317 | + <entry> |
| 318 | + <para>Resource package</para> |
| 319 | + </entry> |
| 320 | + <entry> |
| 321 | + <para><code>library</code></para> |
| 322 | + </entry> |
| 323 | + <entry> |
| 324 | + <para>specified</para> |
| 325 | + </entry> |
300 | 326 | </row>
|
301 | 327 | <row>
|
302 |
| - <entry> <para>Library package</para> </entry> |
303 |
| - <entry> <para><code>library</code></para> </entry> |
304 |
| - <entry> <para>not specified</para> </entry> |
| 328 | + <entry> |
| 329 | + <para>Library package</para> |
| 330 | + </entry> |
| 331 | + <entry> |
| 332 | + <para><code>library</code></para> |
| 333 | + </entry> |
| 334 | + <entry> |
| 335 | + <para>not specified</para> |
| 336 | + </entry> |
305 | 337 | </row>
|
306 | 338 | </tbody>
|
307 | 339 | </tgroup>
|
|
338 | 370 | <term><tag>permissions</tag></term>
|
339 | 371 | <listitem>
|
340 | 372 | <para>You can define package specific permissions in the
|
341 |
| - <literal>repo.xml</literal> to use when uploading package contents like |
342 |
| - this: </para> |
| 373 | + <literal>repo.xml</literal> to use when uploading package contents |
| 374 | + like this: </para> |
343 | 375 | <programlisting language="xml" xlink:href="listings/listing-9.xml"/>
|
344 | 376 | <para> All resources and collections will be owned by the specified user and
|
345 | 377 | permissions will be changed to those given in <literal>mode</literal>.
|
|
350 | 382 | automatically on all XQuery files, in addition to the default
|
351 | 383 | permissions defined in the descriptor. For more control over
|
352 | 384 | permissions, use a post-install XQuery script (see element
|
353 |
| - <tag>finish</tag> below).</para> |
| 385 | + <tag>finish</tag> below).</para> |
354 | 386 | <para> It is generally recommended to specify users in this manner when a
|
355 | 387 | package requires write privileges to the database, and to use a custom
|
356 | 388 | user-group (i.e. not <code>dba</code>). To avoid conflicts with locally
|
|
366 | 398 | <para>Points to an XQuery script inside the root of the package archive,
|
367 | 399 | which will be executed before any package data is uploaded to the
|
368 | 400 | database. By convention the XQuery script is called
|
369 |
| - <literal>pre-install.xql</literal>, but this is not a |
| 401 | + <literal>pre-install.xql</literal>, but this is not a |
370 | 402 | requirement.</para>
|
371 | 403 | <para>If you create a package via eXide, it will generate a default
|
372 |
| - <literal>pre-install.xql</literal> which uploads the default collection |
373 |
| - configuration to the system collection. This needs to be done before |
374 |
| - deployment to guarantee that index definitions are applied when data is |
375 |
| - uploaded to the db.</para> |
| 404 | + <literal>pre-install.xql</literal> which uploads the default |
| 405 | + collection configuration to the system collection. This needs to be done |
| 406 | + before deployment to guarantee that index definitions are applied when |
| 407 | + data is uploaded to the db.</para> |
376 | 408 | <para>The target collection, the file system path to the current package
|
377 | 409 | directory and eXist-db's home directory, are passed to the script as
|
378 | 410 | external variables:</para>
|
|
388 | 420 | This will be executed <emphasis>after</emphasis> all data has been
|
389 | 421 | uploaded to the database. It receives the same external variables as the
|
390 | 422 | prepare script. The convention is to name the script
|
391 |
| - <literal>post-install.xql</literal>.</para> |
| 423 | + <literal>post-install.xql</literal>.</para> |
392 | 424 | <para>Use the <tag>finish</tag> script to run additional tasks or move data
|
393 | 425 | into different collections. For example, the XQuery function
|
394 | 426 | documentation app runs an indexing task from the finish trigger to
|
|
434 | 466 | <title>Configuring the repository root</title>
|
435 | 467 |
|
436 | 468 | <para>The root collection for deployed packages can be configured in
|
437 |
| - <literal>conf.xml</literal>:</para> |
| 469 | + <literal>conf.xml</literal>:</para> |
438 | 470 | <programlisting language="xml" xlink:href="listings/listing-11.xml"/>
|
439 | 471 | <para>The install location specified in the <tag>target</tag> element of
|
440 |
| - <literal>repo.xml</literal> will always be relative to this root collection.</para> |
| 472 | + <literal>repo.xml</literal> will always be relative to this root collection.</para> |
441 | 473 | <para>eXist-db's URL rewriting is by default configured to map any path starting with
|
442 | 474 | <code>/apps</code> to the repository root collection. Check
|
443 |
| - <literal>etc/webapp/WEB-INF/controller-config.xml</literal> and the <link |
444 |
| - xlink:href="urlrewrite">URL rewriting documentation</link>.</para> |
| 475 | + <literal>etc/webapp/WEB-INF/controller-config.xml</literal> and the <link |
| 476 | + xlink:href="urlrewrite">URL rewriting documentation</link>.</para> |
445 | 477 | </sect1>
|
446 | 478 |
|
447 | 479 | <!-- ================================================================== -->
|
|
453 | 485 | programmatically install, remove or inspect packages. The Dashboard Package Manager
|
454 | 486 | relies on the same functions.</para>
|
455 | 487 | <para>The module distinguishes between <emphasis>installation</emphasis> and
|
456 |
| - <emphasis>deployment</emphasis> steps. The reason for this distinction is: while the |
| 488 | + <emphasis>deployment</emphasis> steps. The reason for this distinction is: while the |
457 | 489 | installation process is standardized by the EXPath packaging specification, the
|
458 | 490 | deployment step is implementation defined and specific to eXist-db.
|
459 |
| - <emphasis>Installation</emphasis> will register a package with the EXPath packaging |
| 491 | + <emphasis>Installation</emphasis> will register a package with the EXPath packaging |
460 | 492 | system, but not copy anything into the database. <emphasis>Deployment</emphasis> will
|
461 | 493 | deploy the application into the database as specified by the <literal>repo.xml</literal>
|
462 | 494 | descriptor.</para>
|
|
489 | 521 | distribute applications to your customers. The eXist-db repository is implemented by the
|
490 | 522 | application package <code>http://exist-db.org/apps/public-repo</code>. The code can be
|
491 | 523 | downloaded from the <link condition="_blank"
|
492 |
| - xlink:href="https://github.com/eXist-db/public-xar-repo">eXist-db GitHub</link> |
| 524 | + xlink:href="https://github.com/eXist-db/public-xar-repo">eXist-db GitHub</link> |
493 | 525 | repo.</para>
|
494 | 526 | <para>Once you have built and installed the app, you can upload the package
|
495 | 527 | <code>.xar</code> files you wish to distribute into the collection
|
496 |
| - <literal>public-repo/public</literal>. To make the uploaded <code>.xar</code> files |
| 528 | + <literal>public-repo/public</literal>. To make the uploaded <code>.xar</code> files |
497 | 529 | available, run the query <literal>public-repo/modules/update.xql</literal> once as an
|
498 | 530 | <code>admin</code> user. This will create a document <literal>apps.xml</literal> in
|
499 |
| - <literal>public-repo/public</literal>.</para> |
| 531 | + <literal>public-repo/public</literal>.</para> |
500 | 532 | </sect1>
|
501 | 533 |
|
502 | 534 | </article>
|
0 commit comments