Skip to content

26 q2#631

Draft
dariok wants to merge 90 commits into
developmentfrom
26Q2
Draft

26 q2#631
dariok wants to merge 90 commits into
developmentfrom
26Q2

Conversation

@dariok

@dariok dariok commented May 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

dariok and others added 30 commits April 20, 2026 14:26
- create and use a map in XQuery
- store a detailed string in HTML meta
- create and use a Map in JS

Cf. #580
- in api.xq, add header Accept to a parameter in the request map

Cf. #579
…search

- adjust search.xqm to use IDs for forms (→ eventListener)
- search.xsl must support XML as returned from new API
- search.js handles onSubmit of FTS search form

Cf. #579
- use consistent wording
- always use `result` when returning lists
- streamline the definition and use
Cf. #579

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Used for paging project-based search and for creating KWIC for a file. This way, KWIC does not require a new search if the session is still active.

Cf. #579

Co-authored-by: Copilot <copilot@github.com>
Results are now grouped by their computed path (below tei:text). This means we can add info about structural elements to the HTML view.

This can also be used to filter the results. This might be more efficient than creating fields beforehand.
Ideally, we can drop most of the specialised idexes.

Cf. #579 #566
In general, only tei:text is indexed, with head getting an additional index, and note handled separately

Cf. #566
Co-authored-by: Copilot <copilot@github.com>
Includes improved creation of JSON output
and additional error handling and documentation

Co-authored-by: Copilot <copilot@github.com>
include changes to wdbDocument.loadContent
this is now smarter and accepts an optional selector indicating what to extract from the response

Cf. #579
as we modify the request to add a header, auth needs to be set explicitly or will not be executed, meanin all operations requiring auth will fail
Projects created inherit owner and rights from parent; by default, this should be world readable
The path in found in $model?filePathInfo?mainProject and this does not need repeating. Also, the ID of the project is what’s actually expected here
removed stale code and added an ID in HTML
It erroneously assumed `resources` to reside in the project collection even for sub-projects.

- All calls to applySpecificXsl had to be changed to use the pathInfo map; this included calls to r2:returnResponse which itself calls wdb:applySpecificXls
- `start.xqm` had to be adjusted as it expects an element but now gets the response map
@dariok

dariok commented May 20, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3bb637c69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread edoc/rest2/resources.xqm Outdated
Comment thread edoc/rest2/rest-common.xqm
dariok added 4 commits May 21, 2026 13:06
As the API definition always starts with `/api/v2/`, Swagger’s base URL must not contain it. To keep things uniform, we always add `api/V2` in rest-common.
Cf. #631 (comment)
@dariok

dariok commented May 21, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfffb1283e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread edoc/controller.xql Outdated
Comment thread edoc/rest2/rest-common.xqm Outdated
Comment thread edoc/rest2/resources.xqm Outdated
@dariok

dariok commented Jun 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3501d6798

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread edoc/modules/wdb-process.xqm Outdated
Comment thread edoc/resources/js/admin.js
@dariok

dariok commented Jun 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f6a83ba12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread edoc/rest2/search.xqm Outdated
import module namespace kwic = "http://exist-db.org/xquery/kwic";
import module namespace r2 = "https://github.com/dariok/wdbplus/rest2/common" at "rest-common.xqm";
import module namespace wdb = "https://github.com/dariok/wdbplus/wdb" at "../modules/app.xqm";
import module namespace wdbErr = "https://github.com/dariok/wdbplus/errors" at "error.xqm";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Point the error import at the existing module

When the new search module is loaded for any /api/v2/search/... request, this relative import resolves within edoc/rest2/, but there is no edoc/rest2/error.xqm in the repo; the existing error module is edoc/modules/error.xqm (other modules import it as ../modules/error.xqm). As a result, importing search.xqm from api.xq can fail before either search endpoint runs.

Useful? React with 👍 / 👎.

Comment thread edoc/rest2/search.xqm Outdated
Comment on lines +102 to +103
"self": concat($r2:base, 'search/ft/resource/', $request?parameters?id, '?q=', $query),
"from": $r2:base || 'resources/' || $request?parameters?id,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the API prefix in search result links

With config.xml now making $r2:base the app root (.../edoc) instead of the API root, concatenating bare search/... and resources/... here returns malformed links such as https://localhost/exist/apps/edocsearch/ft/resource/... and .../edocresources/... in successful file-search responses. Clients following the self or from URLs from /api/v2/search/ft/resource/{id} will be sent to non-existent paths; these should use the same $r2:urls prefixes used elsewhere in the commit.

Useful? React with 👍 / 👎.

@dariok

dariok commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@dariok dariok requested a review from WunschK July 2, 2026 23:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a8278c5b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread edoc/modules/app.xqm
Comment on lines +298 to +299
for $step in $sel[1]/*
return <step type="{ $step/@type }">{ $base || normalize-space($step) }</step>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve legacy command text when building steps

Existing project metadata can still use the old command form, e.g. edoc/data/documentation/wdbmeta.xml has <command type="xsl">resources/xsl/tei-transcript.xsl</command>. This conversion only iterates child elements of the command, so that metadata produces a process with no meta:step; wdbProc:process then receives an empty sequence for a element(meta:step)+ parameter and resource views for those existing projects return 500 instead of rendering. Handle the text/@type form or migrate all bundled and existing metadata.

Useful? React with 👍 / 👎.

Comment thread edoc/rest2/search.xqm
) else (),
r2:returnResponse($response, $request?headers?Accept, $pathInfo, "search")
)
} catch wdbErr:wdb0000 | wdb0000 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Catch missing search projects by local name

When /api/v2/search/ft/project/{ed} is called with an unknown project, wdbFiles:getFullPath throws QName('https://github.com/dariok/wdbErr', 'wdb0000'), but this catch only matches the wdbErr prefix declared to a different namespace or an unqualified name. The documented and tested 404 case therefore falls through to the generic catch and becomes a 500; use a wildcard catch such as *:wdb0000 like searchFile does.

Useful? React with 👍 / 👎.

Comment on lines +143 to +145
, $fileNameMod := $fileNameBase => replace(',', '') => replace(' ', '_') => replace('&amp;', '-')
=> replace('ä', 'ae') => replace('Ä', 'Ae') => replace('ö', 'oe') => replace('Ö', 'Oe')
=> replace('ü', 'ue') => replace('Ü', 'Ue') => replace('ß', 'ss')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare uploads against the sanitized filename

This stores the resource and metadata under a normalized filename, but the conflict/idempotency checks in projects.xqm and resources.xqm still compare metadata paths against the original uploaded name. For a file named with a space, comma, or umlaut, the first upload records e.g. foo_bar.xml; a subsequent identical PUT with foo bar.xml no longer matches the existing path and is reported as a different-path conflict instead of 204/update.

Useful? React with 👍 / 👎.

Comment on lines +14 to +16
function ( $accumulator as node(), $step as element(meta:step) ) {
switch ( $step/@type )
case "xsl" return wdbProc:processXSL($accumulator, doc(normalize-space($step))/*, $params)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Carry only transformed nodes between process steps

For commands with more than one meta:step, the first XSL step returns a map {status, content}, and fold-left passes that map as the next $accumulator, which is declared as node() and then handed to processXSL. Any multi-step process therefore fails with a type error and becomes a 500; the accumulator needs to be the transformed content node or the function needs to consistently accumulate a map.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant