|
1 |
| --------- |
2 |
| -Overview |
3 |
| --------- |
| 1 | +# EXPath Repo for Elemental |
4 | 2 |
|
5 |
| -eXist db now uses expath repository to resolve external dependencies located in repository to be used by xquery |
6 |
| -and other XML technologies. |
| 3 | +This module uses a .xar file as part of the resources for its tests. |
7 | 4 |
|
8 |
| ------ |
9 |
| -Build |
10 |
| ------ |
| 5 | +The .xar source code is in a separate Maven module and can be found in the `expathrepo-trigger-test` sub-folder. |
| 6 | +To build the .xar file and copy it for use in the tests for this module: |
11 | 7 |
|
12 |
| -This module relies on the presence of the following jar files in the EXIST_HOME/lib/core folder: |
| 8 | +```bash |
| 9 | +cd expathrepo-trigger-test |
| 10 | +mvn clean package |
| 11 | +cp target/exist-expathrepo-trigger-test-6.4.0-SNAPSHOT.xar ../src/test/resources/exist-expathrepo-trigger-test.xar |
| 12 | +``` |
13 | 13 |
|
14 |
| - pkg-repo.jar |
15 |
| - |
16 |
| -(which Florent Georges maintains as part of expath package repo) |
17 |
| - |
18 |
| -If you are building from source then the module build process will try and download |
19 |
| -these files for you. |
20 |
| - |
21 |
| -This module is enabled by default as eXist now depends on expath package manager. |
22 |
| - |
23 |
| -To configure build set in local.build.properties (or build.properties): |
24 |
| - |
25 |
| - include.module.expathrepo = true |
26 |
| - |
27 |
| -To enable or disable expathrepo look in conf.xml for |
28 |
| - |
29 |
| - <module class="org.exist.xquery.modules.expathrepo.ExpathPackageModule" |
30 |
| - uri="http://exist-db.org/xquery/repo" /> |
31 |
| - |
32 |
| ------------- |
33 |
| -XQuery Usage |
34 |
| ------------- |
35 |
| - |
36 |
| -List packages |
37 |
| - |
38 |
| - import module namespace repo="http://exist-db.org/xquery/repo"; |
39 |
| - repo:list() |
40 |
| - |
41 |
| -Install packages |
42 |
| - |
43 |
| - import module namespace repo="http://exist-db.org/xquery/repo"; |
44 |
| - repo:install('functx-1.0.xar') |
45 |
| - |
46 |
| -Replace packages |
47 |
| - |
48 |
| - import module namespace repo="http://exist-db.org/xquery/repo"; |
49 |
| - repo:remove('functx-1.0.xar') |
50 |
| - |
51 |
| - |
52 |
| ---------------- |
53 |
| -Developer Notes |
54 |
| ---------------- |
55 |
| - |
56 |
| -* This module is default built and enabled with eXist |
57 |
| - |
58 |
| -* It downloads expath repo pck-repo.jar and places under lib/core |
59 |
| - |
60 |
| -* start.config now has an entry for this jar |
61 |
| - |
62 |
| -* Main.java/XQueryContext.java will create repository under webapp/WEB-INF/expathrepo if exist.home is present |
63 |
| - |
64 |
| -* Main.java/XQueryContext.java will create repository under /expathrepo if exist.home is not present |
65 |
| - |
66 |
| -* Repository will be placed relative to exist.home or top level directory |
67 |
| - |
68 |
| -* XQueryContext.java will resolve modules in expath repository |
69 |
| - |
70 |
| -* org.exist.xquery.modules.expathrepo exposes repo functionality as XQuery extension functions under |
71 |
| -http://exist-db.org/xquery/repo namespace |
72 |
| - |
73 |
| - |
74 |
| ------- |
75 |
| -Future |
76 |
| ------- |
77 |
| - |
78 |
| -* refactor code, remove any hard codings, add more exception checking |
79 |
| - |
80 |
| -* enhance documentation |
81 |
| - |
82 |
| -* add LocateFunction.java once it works properly inside repo-pkg.jar |
83 |
| - |
84 |
| -* convert existing xquery libs into .xar |
85 |
| - |
86 |
| -* store repository inside eXist ? |
87 |
| - |
88 |
| -* add CreateFunction.java to create new repositories |
89 |
| - |
90 |
| -* load .xar into eXist ? |
91 |
| - |
92 |
| - |
93 |
| -------------------------- |
94 |
| -Issues/Status/Limitations |
95 |
| -------------------------- |
96 |
| - |
97 |
| -* currently test/src/xquery/expathrepo unit tests disabled |
98 |
| - |
99 |
| -* repo.removePackage seems to throw PackageException on success (will follow up with Florent Georges) |
100 |
| - |
101 |
| -* eXist-db requires a restart to recognize changes to packages loaded or removed from repository |
102 |
| - |
103 |
| -* expath repository directory needs to be initiated by eXist (in XQueryContext on startup |
| 14 | +Each time you modify the source code of the `expathrepo-trigger-test` module, you should rebuild it and copy the .xar file to the `src/test/resources` folder of this module and re-commit it to Git. |
0 commit comments