Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
336 commits
Select commit Hold shift + click to select a range
7dc1322
better handling of multiple file/project index entries
dariok Feb 6, 2025
cdee691
REST must not enter files/project into index
dariok Feb 6, 2025
9fb21c7
validation for XQuery
dariok Feb 6, 2025
5510486
grow/shrink main and aside in view
dariok Mar 17, 2025
04b6c60
import view.xqm in main view
dariok May 13, 2025
366c9d4
adjust extraction of document title
dariok May 13, 2025
d98ac64
add OAI-PMH and DTS endpoints to planned REST v2
dariok May 13, 2025
f1ed24e
Merge pull request #585 from dariok/25Q1
dariok May 22, 2025
a3eea68
improve nav
dariok Jul 12, 2025
15d842f
some local tests for endpoints (old API)
dariok Jul 12, 2025
39543f0
Merge pull request #596 from dariok/25Q2
dariok Jul 12, 2025
8b40fdf
button in coookie info to full height
dariok Jul 12, 2025
118e35b
start: licence info as div with heading
dariok Jul 12, 2025
bd2135f
extend error.xqm, expect numerical keys
dariok Jul 16, 2025
4df43c5
add path to xslt as meta
dariok Jul 16, 2025
9e298fd
add missing gt to make file wellformed
dariok Jul 16, 2025
63adbc9
use image instead of attrib balue in image link
dariok Jul 16, 2025
34137a9
use processes as wrapper for process as per current schema
dariok Jul 16, 2025
f852856
error: don’t set status code when in REST
dariok Jul 16, 2025
eadd118
revert grid columns to 1fr 1fr
dariok Jul 17, 2025
9a692b7
bug fixing in getResourceById and wdbfiles
dariok Jul 17, 2025
ad2255f
XSLT selection: use view parameter if one is present
dariok Jul 17, 2025
87c5316
populate model must pass view parameter to XSLT selection
dariok Jul 17, 2025
5afb855
search instance specific funstion.js in data/resources/js
dariok Jul 17, 2025
6b48e26
getXsl return process element
dariok Jul 17, 2025
8b9b42c
wdbmeta stub: use uniform path for xsl
dariok Jul 17, 2025
e9f843a
file transformations are in a separate module now
dariok Jul 17, 2025
af623ea
view.xqm now uses wdbProcess to get contents
dariok Jul 17, 2025
19a1602
add struct[@xml:id] to file index
dariok Jul 17, 2025
fa7d555
when creating a project, add option to create a subproject
dariok Jul 17, 2025
b93eb71
remove unused wddb:getFilePath
dariok Jul 17, 2025
87bbbaa
wdbmeta for sub-projets uses process inheritance
dariok Jul 18, 2025
dcf3049
Create new structure for all resources collections
dariok Jul 18, 2025
1462490
create new collection structure in data/resources and edoc/resources
dariok Jul 18, 2025
5afda59
new structure of resources: adjust loading CSS and JS
dariok Jul 18, 2025
f7b68c7
adjust to new resource structure for XSLTs
dariok Jul 18, 2025
c39390a
new structure of resources: adjust links to specific HTML
dariok Jul 18, 2025
b28f837
forgot an instance of CSS in new structure
dariok Jul 18, 2025
cc94318
project XSLT templates only import instance’s XSLTs
dariok Jul 18, 2025
e6ba900
porject.xqm is created of a main project but not sub-projects
dariok Jul 18, 2025
51e653f
prepared a list of main changes in README
dariok Jul 18, 2025
d2d4d04
Move wdbmeta to admin and include only necessary content
dariok Jul 21, 2025
a326e14
move to Xuery 3.1
dariok Jul 21, 2025
93c21c9
updated XString
dariok Jul 23, 2025
979529a
Create data/logs with general errors.xml for logging
dariok Jul 23, 2025
d3a312f
wirte errors to logs/error.xqm in addition to log4j
dariok Jul 23, 2025
1e987c8
fix model creation without ed or id (= for data)
dariok Jul 23, 2025
ffa1d7c
UUIDs are not always valid xs:id
dariok Jul 23, 2025
b581cce
prepare basics to use Roaster for RESTv2
dariok Sep 4, 2025
866732b
create project for documentation
dariok Sep 4, 2025
938a6ee
(for now) do not index documentation
dariok Sep 4, 2025
c78feec
REST2: list all projects
dariok Sep 4, 2025
10dfb4e
return JSON as useful JSON – no double serialization
dariok Sep 5, 2025
3d1160d
[RESTv2] GET projects
dariok Oct 23, 2025
4932e2c
global wdbmeta.xml must containt processes
dariok Oct 24, 2025
7ddb26c
[nav] empty struct must not throw errors
dariok Oct 24, 2025
d235138
host SwaggerUI files locally
dariok Oct 25, 2025
55b0bbf
[REST] handle login uniformly throught API (Roaster)
dariok Oct 25, 2025
a938bf8
unit testing for GET, OPTIONS projects
dariok Oct 28, 2025
e4543c7
Merge pull request #597 from dariok/25Q3
dariok Nov 1, 2025
e8d9d2b
REST2 projects: prepare "create project (POST)"
dariok Nov 19, 2025
c63e83e
login must make use of new API
dariok Dec 19, 2025
e96b284
make logs world-writable
dariok Dec 19, 2025
73d7d0a
build must use correct paths
dariok Dec 19, 2025
1164844
mover start.xsl to resources/xsl
dariok Dec 19, 2025
7ca8b26
(old API) do not insert import into wdbmeta.xml
dariok Dec 19, 2025
fa73329
[REST2] projects: create new project
dariok Dec 22, 2025
4892149
function page start: keep original error description
dariok Dec 22, 2025
9ca5c81
function.js: make call to new login endpoint
dariok Dec 22, 2025
ec5c9f5
[REST] when creating a new collection, always create texts
dariok Dec 22, 2025
466bac6
use correct path for login
dariok Dec 22, 2025
a740dec
[REST] new project via REST2
dariok Dec 22, 2025
85c5194
Use $global for $wdb:data/resources
dariok Jan 3, 2026
537f9ff
improve creation of JSON out of REST lists
dariok Jan 4, 2026
4257ec8
REST2 list project views
dariok Jan 4, 2026
4c1df4b
use <list> uniformly for list-like results
dariok Jan 4, 2026
cd27003
improve definition of a list of views
dariok Jan 4, 2026
bb47a92
restructure and improve API defintion
dariok Jan 5, 2026
2882985
REST: use name+s when creating JSON for list-like XML
dariok Jan 5, 2026
86965fa
update npm packages
dariok Jan 5, 2026
a23ae86
[REST2] more refinements on YAML
dariok Jan 6, 2026
87c87da
[REST2] GET projects/{ed}
dariok Jan 6, 2026
a2a1d0c
fix a missing variable declaration
dariok Jan 6, 2026
5b3db79
[REST2] DELETE projects/{ed}
dariok Jan 6, 2026
323bffe
[REST2] GET /projects/{ed}/subprojects
dariok Jan 7, 2026
5d33c96
[REST2] 409 when collection in use
dariok Jan 7, 2026
739bd0b
Merge pull request #613 from dariok/25Q4
dariok Jan 7, 2026
d6d4fb4
model: case $ed = 'data'
dariok Jan 7, 2026
6942078
update cannot delete root element
dariok Jan 7, 2026
1e086b1
update project index: include project title
dariok Jan 8, 2026
af3acc3
[REST2] /projects/{ed}/views/{view}
dariok Jan 8, 2026
d45e0c6
generic function to apply framework XSLTs
dariok Jan 8, 2026
2b9813e
[REST2] projects/{ed}/views/navigation
dariok Jan 8, 2026
4c25674
start: use new REST functions for content and nav
dariok Jan 8, 2026
122c2d0
functions processing return maps
dariok Jan 9, 2026
a2b46c9
upload form uses `edition` as default destination
dariok Jan 9, 2026
b88d71b
add comments in templated HTML
dariok Jan 9, 2026
99998d6
Addins with new model
dariok Jan 19, 2026
3310976
implement list of project resources
dariok Jan 19, 2026
75bf2d5
move nav.xsl to respect new structure in resources
dariok Feb 2, 2026
2c64283
add documentation for applySpecificXsl()
dariok Feb 2, 2026
806da0a
generic TEI transformation: p may have `@style`
dariok Feb 2, 2026
aaa2ff1
styling of fn-number: is now a button that needs more info
dariok Feb 2, 2026
d53491b
set paths for REST v1 and v2 in config.xml
dariok Feb 3, 2026
cd2c2a9
additional security headers
dariok Feb 3, 2026
7bd200b
get content must not return map as content
dariok Feb 4, 2026
a4f3322
update jQuery and jQueryUI
dariok Feb 4, 2026
687f754
move apiv2.html (Swagger UI) to rest2
dariok Feb 4, 2026
9a825ad
set headers when viewing standard HTML files
dariok Feb 4, 2026
01fd25d
move search.xsl to resources/xsl and use function for specific XSLTs
dariok Feb 6, 2026
e4fb2bd
improve security headers
dariok Feb 9, 2026
fe02917
applySpecificXsl extended to allow parameters
dariok Feb 9, 2026
26c10fe
improve HTML putput of error reports
dariok Feb 10, 2026
4ab4971
return better info when an XSLT was not found
dariok Feb 10, 2026
50c1f8e
controller: auth is handled by roaster
dariok Feb 10, 2026
96f2dac
move function to parse multipart to a separate module
dariok Feb 11, 2026
fda74de
parse multipart bodies for API requests other than PUT
dariok Feb 11, 2026
c44e120
absolte positioning for div in aside
dariok Feb 12, 2026
bc50aca
update npm packages for mocha testing and linting
dariok Feb 12, 2026
83e2cb8
improvements for footnotes
dariok Feb 12, 2026
5eea166
footnotes: use variables to keep track of types
dariok Feb 12, 2026
d0c61bf
common.xsl: create a strucutred footer with links
dariok Feb 12, 2026
9ec4002
fn-numbers in em, not in rem
dariok Feb 13, 2026
d0dfc9f
PUT and POST to create or update files
dariok Feb 20, 2026
4c7fd2a
use wdbFile:getFullPath instead of directly accessing project index
dariok Feb 21, 2026
d23d689
add @data-type to buttons from rs
dariok Mar 2, 2026
5370763
file upload in projects endpoint
dariok Mar 2, 2026
a006a08
REST2 projects: do not allow deleting data collection
dariok Mar 2, 2026
6664b3c
PUT/POST resources in a project, including tests
dariok Mar 4, 2026
e4ec5ff
[REST2] DELETE project: delete wdbmeta entries
dariok Mar 4, 2026
a6fd779
Implement resources endpoint
dariok Mar 25, 2026
71e8ce0
wdbFiles:evaluateIfModifiedSince must deal with parsed and unparsed I…
dariok Mar 25, 2026
e9cf9cb
[Rest v2] resources: GET and HEAD resource need to return identical i…
dariok Mar 25, 2026
ac944e6
[Rest v2] resources GET view: return 406 if no view is found
dariok Mar 25, 2026
9103cbf
Update tests for improved tets runs
dariok Mar 25, 2026
aff47f5
use correct import path in legacy rest-files.xql
dariok Apr 9, 2026
40cb62f
Fix typos in RESTv2
dariok Apr 9, 2026
8b122b3
Fix some typos
dariok Apr 9, 2026
b4573de
Improve selection of XSLT for a file view
dariok Apr 9, 2026
ad34687
use explicit type information in pathInfo
dariok Apr 9, 2026
3ae1cf2
explicitly use one meta:file only in update metadate operations
dariok Apr 9, 2026
1e7b755
ensure processXQuery receives process
dariok Apr 9, 2026
6acddf2
[REST2] resources: make sure metadata update actually does update
dariok Apr 9, 2026
efe96f6
update module import path in legacy API
dariok Apr 9, 2026
5e39aa2
[REST2] projects: delete project must recurse subprojects
dariok Apr 20, 2026
36de3ed
typo in tei-common.xsl
dariok Apr 20, 2026
d158622
[REST2] projects: use "navigation" consistently for nav view
dariok Apr 20, 2026
c4127fd
Merge pull request #619 from dariok/26Q1
dariok Apr 20, 2026
50d01f9
small code improvements
dariok Apr 20, 2026
d037dd4
minor errors
dariok Apr 21, 2026
4de7afe
remove XString
dariok Apr 21, 2026
670ec66
Support versions of REST URLs
dariok Apr 22, 2026
0bc767f
[REST2] search: search in collection (1st pass)
dariok Apr 22, 2026
6827042
[REST2] search: JS from search.html uses new endpoint for collection …
dariok Apr 22, 2026
ac63d7c
[REST2] make API definition more consistent
dariok Apr 22, 2026
6257d3b
[REST2] resources byPid now returns HTTP 303
dariok Apr 22, 2026
82223f5
[REST"] fts search within a file
dariok Apr 25, 2026
926747f
[REST2] wrapper function to return a uniform result element
dariok Apr 25, 2026
bf04a20
[REST2] search Store results in session and re-use
dariok Apr 25, 2026
879024d
[REST2] search include KWIC and path info in file results
dariok Apr 25, 2026
8045aed
[REST2] search simplfied index defintion
dariok Apr 25, 2026
0c3a617
wdbFiles: “kind” → “type”
dariok Apr 26, 2026
5fab5ba
simple call graph
dariok Apr 26, 2026
d5b4aec
[REST2] search uniform creation of results for both stored and new
dariok Apr 27, 2026
d3d9ec7
[REST2] search search page makes use of new API
dariok Apr 27, 2026
c3fac08
a full recreation of the project+file indexes required re-indexing
dariok May 7, 2026
9d33b3c
[REST2] must explicitly call authorization in routing definition
dariok May 7, 2026
a15d13a
fix multiple errors introduced by an S+R operation
dariok May 7, 2026
486d0bc
wdb.report: always print trace to console (except for success messages)
dariok May 7, 2026
eac9e4a
explicitly set headers for CORS-Preflight as Jetty will not pass OPTI…
dariok May 10, 2026
27ff9ac
[REST2] admin uploads now use the new API
dariok May 10, 2026
65c04d1
[REST2] check project creation and all uploads work as expected
dariok May 10, 2026
64cce3a
[REST2] upload: when creating a collection, set owner
dariok May 10, 2026
cc24531
[Install] set owner of `data` as wdb:wdbusers
dariok May 10, 2026
2a595b0
some refactoring on post-install.xql
dariok May 10, 2026
05c3ca1
model.xqm: map kex "mainEd" must contain the ID of the main ed
dariok May 10, 2026
fe2b221
[REST2] search now uses new API via AJAX
dariok May 11, 2026
d51c6ff
app:applySpecificXsl must use main project’s resources
dariok May 11, 2026
84c9aa1
nav.xsl: additional way of parsing numbering to order entries
dariok May 11, 2026
20d5671
bump node dependencies
dariok May 11, 2026
790a85f
some code maintenance
dariok May 11, 2026
cbcc44f
some cleaning in controller
dariok May 12, 2026
86ae54c
installation dependency of roaster updated to v. 1.11.0
dariok May 12, 2026
8e324ec
cleanup post-install.xql: XString has been removed
dariok May 12, 2026
46e8269
index definitions: simplify defintions
dariok May 12, 2026
c837619
wdb:getXslFromWdbMeta(): do not throw error if no process is found
dariok May 12, 2026
c4ebecd
function.xqm: adjust error message
dariok May 13, 2026
d5cc3b9
wdb-process.xqm: add a missing return statement
dariok May 13, 2026
ba55dab
[REST2] resources: list of views must include ancestor wdbmeta
dariok May 13, 2026
7c34874
[REST2] projects adjustments for process inheritance
dariok May 13, 2026
d8e0f1e
typos
dariok May 13, 2026
498b549
use new API to load navigation
dariok May 13, 2026
4818e82
make names for API meta files uniform
dariok May 13, 2026
edbe9cb
[REST2] uniform URL creation via map
dariok May 18, 2026
3af2434
[REST2] list of resources is only available as XML or JSON
dariok May 18, 2026
e02c0f4
[REST2] cleanup in media type handling
dariok May 18, 2026
da5cda7
Use URLSearchParams()
dariok May 18, 2026
1eeb4d5
[REST2] build URL only once in function.js
dariok May 19, 2026
881f7fd
use URL() API to construct URLs
dariok May 19, 2026
be3c2b5
toggleNavigation now uses new API
dariok May 19, 2026
4f39efc
admin.js uses URL() API and wdb.restUrl
dariok May 19, 2026
2a2b84f
Bump Mocha to 11.7.6
dariok May 19, 2026
e7a473f
login via roaster does not need Basic Auth headers
dariok May 19, 2026
245bb43
admin.js: assume we’re not proxied
dariok May 19, 2026
7d39040
set owner and permissions only in a file is newly created
dariok May 19, 2026
ba1724d
update licence in repo.xml to match the one stated in the git repo
dariok May 19, 2026
05df0aa
Create group "wdbadmin" in post-install
dariok May 19, 2026
7bdb949
support to process a sequence of meta:commands
dariok May 20, 2026
c041696
remove scaffolding
dariok May 20, 2026
176411c
process selection now makes use of process/command/steps
dariok May 20, 2026
f75499e
extend generic wdbmeta files to match multistep-processing requirements
dariok May 20, 2026
88e5809
remove unused util:log() with undeclared var
dariok May 20, 2026
bcb658d
use correct model keys for Accept header
dariok May 20, 2026
78a444e
[REST2] projects Fix evaluation of paths for file uploads
dariok May 20, 2026
9ec4fe3
[REST2] resources fix tests
dariok May 20, 2026
3ccfcad
adjust creation of filename and path to changed endpoint
dariok May 20, 2026
1be8530
additional tests
dariok May 20, 2026
7324afd
fix wrong comparison
dariok May 20, 2026
f3bb637
more general headers for OPTIONS requests
dariok May 20, 2026
6613294
remove inline-JS
dariok May 21, 2026
2223588
change REST2 base to simply `.../edoc`
dariok May 21, 2026
b23b008
resource views: traverse up to data withou imports
dariok May 21, 2026
dfffb12
[REST2] resources views: show views only once
dariok May 21, 2026
8db248d
apiv2.html has been renamed to v2.html
dariok May 21, 2026
0bbece7
use 'numberingTitle' when adding a view element
dariok May 21, 2026
c3501d6
remove always-on error logging
dariok May 21, 2026
3878777
update node dependencies
dariok Jun 2, 2026
0b320b8
add Access-Control headers for login/logout
dariok Jun 2, 2026
65b2a03
wdbProc:process works on meta:step
dariok Jun 2, 2026
e71b261
add a note describing the intended behaviour for paths of uploads
dariok Jun 2, 2026
d38fdb2
update login in JS
dariok Jun 2, 2026
70db507
add an optional base URL to login and logout
dariok Jun 2, 2026
5b6c4a3
Use own handler for login/logout
dariok Jun 3, 2026
2f6a83b
search.js must use wdb.restUrl
dariok Jun 3, 2026
16f9ece
docs: removed ACDH section in currently used projects
csae8092 Jun 20, 2026
c4920f1
fix for scrollintoview
dariok Jul 2, 2026
5d180ee
fix file name when uploading
dariok Jul 2, 2026
357e693
load result when search page is loaded with query params
dariok Jul 2, 2026
4a8278c
path and string fixes in search.xqm
dariok Jul 2, 2026
90565dc
documentation wdbmeta must follow expectations
dariok Jul 11, 2026
b87beac
when searching, catch 404 from all namespaces
dariok Jul 11, 2026
c5619e7
processing steps must use a map in fold-left
dariok Jul 11, 2026
527933a
when working with file names, always use a sanitised version
dariok Jul 11, 2026
5ddeab1
fix typo (missing $)
dariok Jul 11, 2026
19a4ed4
search.js must get project ID from query parameter
dariok Jul 11, 2026
baabe32
documentation: fix command type in wdbmeta
dariok Jul 11, 2026
b49d455
initial upload: use sanitised file name for 204 as well
dariok Jul 11, 2026
5cdcabb
bump node modules
dariok Jul 11, 2026
61c598c
Merge pull request #631 from dariok/26Q2
dariok Jul 13, 2026
e8cedb4
Merge pull request #633 from csae8092/development
dariok Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ __pycache__/
# internal
edoc/resources/xsl/xspec/
.existdb.json
edoc/rest2/v2.json

# node-reladted stuff
node_modules/

.codex
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "edoc/include/xstring"]
path = edoc/include/xstring
url = https://github.com/dariok/XStringUtils
[submodule "edoc/include/wdbmeta"]
path = edoc/include/wdbmeta
url = https://github.com/dariok/wdbmeta
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,47 @@ This framework still lacks a good name. If you have an idea, please let me know!

## Incompatible changes

### 25Q3

Release 25Q3 dropped support for more unsued functions:
- `wdb:getFilePath ( $id as xs:string )`: use the map from `wdbFiles:getFullPath` instead
- the default layout of all `resources` collections has changed to group files by type. This also affects the main
project specific overrides, i.e. `project.js` and `project.css`. An XQuery is provided to move all files to their
appropriate new locations (TODO: add file name here).
This also affects `edoc/data/resources` and `edoc/resources` so you might have to change imports manually if you make
use of any file in these collections.

Changes in standard behaviour
- sub-projects will now make use of process inheritance; i.e., they only define empty `processes` with no `command`. A
`command` is then picked by traversing up through parent `wdbmeta.xml` (i.e., one that is pointed to by a
`struct/import`; worst case: data). This way, you can still have different `command` defined for sub-projects (and
their children) but do not need to change the path for every sub-project.
- as part of this, no XSLTs are being copied to `{$subproject}/resources` as inheritance is now the standard. This way,
surplus XSLTs do not have to be deleted or kept up to date. As said above, it is still possible to create a `command`
for this sub-project tree and create specific XSLTs (usually by including the main XSLTs)
- standard XSLTs for a new project are now bare: they only include `/edoc/data/resources/xslt/{$currentFileName}`, and
`tei-common.xsl` (unless it’s common itself).

### 24Q4

Release 24Q4 dropped another set of functions that were unused:
- `wdb:getEdFromFileID( $id as xs:string )`: `(wdbFiles:getFullPath($id))?projectPath` returns the base path to `wdbmeta.xml`
- `wdb:getMetaElementFromEd ( $ed as xs:string )`: use
`doc( (doc("/db/apps/edoc/index/project-index.xml")/id($ed))/@path || '/wdbmeta.xml' )/id($ed)[self::meta:projectMD]` instead
- `wdb:getMetaFile( $pathToEd )`: `(wdbFiles:getFullPath($ed))?projectPath` returns the base path to `wdbmeta.xml`
- `wdb:getProjectPathFromId ( $ed )`: use `(wdbFiles:getFullPath($ed))?projectPath` instead

### 24Q2

Release 24Q2 dropped functions `wdb:getEdPath( $ed as xs:string , $absolute as xs:boolean() )`,
`wdb:getEdPath( $ed as xs:string )`, and `wdb:findProjectXQM( $project )`. These queries can be replaced by
`(wdbFiles:getFullPath($id))` which returns a map with `projectPath` (the path to the project, i.e. the collection where
`wdbmeta.xml`¹ is stored), `collectionPath` (for the subcollection where a file is actually located), `mainProject` for
the path to the project containing `project.xqm`, and `fileName`.
1) (24Q4): this corrects a typo as previous versions incorrectly read `project.xqm`.

### 24Q1

Release 24Q1 dropped support for METS-based projects. As METS files can have a number of very different ways of encoding
information, especially when it comes to behaviours, native support is hard to achieve. At the same time, most
installations use wdb+’s native wdbmeta system as this is what the admin functions work with.
Expand Down Expand Up @@ -64,9 +105,11 @@ into `/db/apps/edoc` and want to put your projects into `/db/apps/edoc/data/your
<files>
<file path="pathTo.xml" xml:id="xml-id" />
</files>
<process target="html">
<command type="xsl">/db/apps/edoc/resources/xsl/tei-transcript.xsl</command>
</process>
<processes>
<process target="html">
<command type="xsl">/db/apps/edoc/resources/xsl/tei-transcript.xsl</command>
</process>
</processes>
<struct label="1722" order="1722">
<view file="xml-id" label="Title of File" />
</struct>
Expand All @@ -89,12 +132,15 @@ See the Wiki for details!

* HAB Wolfenbüttel
* Editionsprojekt Karlstadt
* ACDH Wien
* Wien[n]erisches Diarium Digital
* Repertotium frühneuzeitlicher Rechtsquellen
* Protokolle der Sitzungen der Gesamtakadmie
* Akademie der Wissenschaften, Heidelberg
* Theologenbriefwechsel
* ULB Darmstadt
* TUEditions
* WDM

If you use wdbplus for your editions, please drop me a message so I can add you to this list.

## Sponsoring

Development of wdb+ is chiefly done in projects funded by DFG and the German BMBF.
Additionally, we would like to say thank you to BrowserStack for giving us sponsored access!
42 changes: 22 additions & 20 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<xmlproperty file="edoc/expath-pkg.xml"/>

<target name="clean">
<delete dir="edoc/build/" />
<delete dir="build" />
</target>

<target name="compile" depends="clean">
<ant dir="edoc" antfile="build.xml" />
<move file="edoc/build" tofile="build" />
</target>

<target name="docker" depends="compile">
<copy file="build/${package(abbrev)}-${package(version)}.xar" tofile="docker/wdb.xar" />
<exec executable="docker" dir="docker">
<arg value="build" />
<arg value="--tag=wdbplus" />
<arg value="." />
</exec>
</target>
<xmlproperty file="edoc/expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="wdb"/>
<property name="build.dir" value="build"/>

<target name="clean">
<delete dir="build" />
</target>

<target name="compile" depends="clean">
<ant dir="edoc" antfile="build.xml" />
<move file="edoc/build" tofile="build" />
</target>

<target name="docker" depends="compile">
<copy file="build/${package(abbrev)}-${package(version)}.xar" tofile="docker/wdb.xar" />
<exec executable="docker" dir="docker">
<arg value="build" />
<arg value="--tag=wdbplus" />
<arg value="." />
</exec>
</target>
</project>
File renamed without changes.
87 changes: 38 additions & 49 deletions edoc/admin/admin.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,61 @@ xquery version "3.1";

module namespace wdbAdmin = "https://github.com/dariok/wdbplus/Admin";

import module namespace console = "http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";
import module namespace templates = "http://exist-db.org/xquery/html-templating";
import module namespace wdb = "https://github.com/dariok/wdbplus/wdb" at "/db/apps/edoc/modules/app.xqm";
import module namespace wdbErr = "https://github.com/dariok/wdbplus/errors" at "/db/apps/edoc/modules/error.xqm";
import module namespace config = "https://github.com/dariok/wdbplus/config" at "../modules/wdb-config.xqm";
import module namespace wdbErr = "https://github.com/dariok/wdbplus/errors" at "../modules/error.xqm";
import module namespace wdbm = "https://github.com/dariok/wdbplus/model" at "../modules/model.xqm";

declare namespace meta = "https://github.com/dariok/wdbplus/wdbmeta";
declare namespace sm = "http://exist-db.org/xquery/securitymanager";
declare namespace meta = "https://github.com/dariok/wdbplus/wdbmeta";
declare namespace sm = "http://exist-db.org/xquery/securitymanager";
declare namespace templates = "http://exist-db.org/xquery/html-templating";
declare namespace wdb = "https://github.com/dariok/wdbplus/wdb";

(:~
: populate the model for functions pages (similar but not identical to wdb:populateModel)
: populate the model for admin pages
:
: @param $ed The ID of a _project_
: @return The model
:)
declare
%templates:default("ed", "")
function wdbAdmin:start ( $node as node(), $model as map(*), $ed as xs:string ) {
try {
let $pathToEd := if ( $ed = "" )
then $wdb:data
else wdb:getEdPath($ed, true())

(: The meta data are taken from wdbmeta.xml :)
let $infoFileLoc := wdb:getMetaFile($pathToEd)
, $title := normalize-space((doc($infoFileLoc)//meta:title)[1])

return map {
"ed": if ( $pathToEd = $wdb:data ) then "data" else $ed,
"infoFileLoc": $infoFileLoc,
"page": substring-after(request:get-uri(), "admin/"),
"pathToEd": $pathToEd,
"title": $title,
"auth": sm:id()/sm:id
}
} catch * {
util:log("error", "No collection found for project ID " || $ed),
map {
"ed": ""
}
}
%templates:default("ed", "data")
function wdbAdmin:start ( $node as node(), $model as map(*), $ed as xs:string ) as item()* {
wdbm:populateModel((), $ed, "", "", "")
};

declare function wdbAdmin:getEd ( $node as node(), $model as map(*) ) as element(meta) {
<meta name="ed" content="{ $model?ed }" />
};
declare function wdbAdmin:getEd ( $node as node(), $model as map(*) ) as item()+ {(
comment { "Created in admin.xqm for "|| $node/@data-template },
<meta name="ed" content="{ $model?ed }" />,
<meta name="path" content="{ $model?pathToEd }" />
)};

declare function wdbAdmin:heading ($node as node(), $model as map(*)) {
declare function wdbAdmin:heading ( $node as node(), $model as map(*) ) as element()+ {
let $opts := if (request:get-parameter('job', '') != '')
then <span class="dispOpts"><a href="global.html">globale Optionen</a></span>
else ()

return (

<h1>{
if ($model?page = 'admin.html')
then "Admin-Seite"
else if ($model?page = 'global.html')
then "Globale Einstellungen"
else if ($model?ed = '')
then "Projekte"
else ("Projekt ", <i>{$model?title}</i>, " (" || $model?ed || ")")
comment { "Created in admin.xqm for "|| $node/@data-template },
if ($model?page = 'admin.html') then
"Admin-Seite"
else if ($model?page = 'global.html') then
"Globale Einstellungen"
else if ($model?ed = '') then
"Projekte"
else (
"Projekt ",
<i>{$model?title}</i>,
" (" || $model?ed || ")"
)
}</h1>,
$opts
)
};

declare function wdbAdmin:getAside ($node as node(), $model as map(*)) as element() {
declare function wdbAdmin:getAside ( $node as node(), $model as map(*) ) as element() {
<aside>
comment { "Created in admin.xqm for "|| $node/@data-template }
<h3>Funktionen</h3>
{
switch ($model?page)
Expand All @@ -88,11 +76,12 @@ declare function wdbAdmin:getAside ($node as node(), $model as map(*)) as elemen
</aside>
};

declare function wdbAdmin:css ( $node as node(), $model as map(*) ) as element()* {
if ( unparsed-text-available($wdb:data || "/resources/wdb.css") )
then <link rel="stylesheet" type="text/css" href="../data/resources/wdb.css" />
declare function wdbAdmin:css ( $node as node(), $model as map(*) ) as item()* {
comment { "Created in admin.xqm for "|| $node/@data-template },
if ( unparsed-text-available($config:data || "/resources/css/wdb.css") )
then <link rel="stylesheet" type="text/css" href="$global/css/wdb.css" />
else (),
if ( unparsed-text-available($wdb:data || "/resources/admin.css") )
then <link rel="stylesheet" type="text/css" href="../data/resources/admin.css" />
if ( unparsed-text-available($config:data || "/resources/css/admin.css") )
then <link rel="stylesheet" type="text/css" href="$global/css/admin.css" />
else ()
};
50 changes: 24 additions & 26 deletions edoc/admin/directoryForm.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<div data-template="templates:surround" data-template-with="templates/admin.html" data-template-at="container">
<h1>Funktion</h1>
<form action="#" method="post">
<fieldset id="selectTask">
<input type="radio" name="task" id="do">Verzeichnis ohne Eintragen in wdbmeta</input><br/>
<input type="radio" name="task" id="dm">Verzeichnis mit Eintragen in wdbmeta</input><br/>
<input type="radio" name="task" id="fo">Datei(en) ohne Eintragen in wdbmeta</input><br/>
<input type="radio" name="task" id="fi" checked="checked">Datei(en) mit Eintragen in wdbmeta</input><br/>
<h1>Funktion</h1>
<form action="#" method="post">
<fieldset id="selectTask">
<input type="radio" name="task" id="dm">Verzeichnis(se) (relative Pfade)</input><br/>
<input type="radio" name="task" id="fi" checked="checked">Datei(en)</input>
</fieldset>
<fieldset id="selectTarget">
<label>Collection: </label>
<pre/>
<br/>
<label>Zielcollection auswählen: </label>
<select name="target">
<option/>
</select>
</fieldset>
<fieldset id="selectInputDir">
<label>Datei auswählen: </label>
<input type="file" id="picker" name="fileList" multiple="multiple" />
</fieldset>
<input type="submit" disabled="disabled"/>
</form>
<p>
<img src="../resources/FhHRx.gif" style="display: none;" alt="loading"/>
</p>
<table id="results"/>
<fieldset id="selectTarget">
<label>Collection: </label>
<pre/>
<br/>
<label>Zielcollection auswählen: </label>
<select name="target">
<option/>
</select>
</fieldset>
<fieldset id="selectInputDir">
<label>Datei auswählen: </label>
<input type="file" id="picker" name="fileList" multiple="multiple" />
</fieldset>
<input type="submit" disabled="disabled"/>
</form>
<p>
<img src="$shared/images/FhHRx.gif" style="display: none;" alt="loading"/>
</p>
<table id="results"/>
</div>
Loading