Skip to content

[Feature] Add xquery recursive collection creation with just one path expression #5062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7ee7a8d
Added create collection from a path, and the one parameter signature.
enima007 Sep 17, 2023
206772a
Added create collection with path signature.
enima007 Sep 17, 2023
66a060e
Added test file for create-collection with path.
enima007 Sep 17, 2023
f907b10
Removed wildcard imports.
enima007 Sep 26, 2023
5135da7
Changed new-collection-uri to collection-uri.
enima007 Sep 26, 2023
78bf82e
Fixed order to public final static as per the JLS.
enima007 Sep 26, 2023
e898899
Fixed catch blocs and thrown exception.
enima007 Sep 26, 2023
31abe51
Fixed current test-case collection names.
enima007 Sep 26, 2023
ff155b8
Merge branch 'eXist-db:develop' into feature/add-xquery-collection-cr…
enima007 Sep 26, 2023
e7118ed
Added cleanCollectionUri function.
enima007 Sep 26, 2023
ac5f200
Remove unused parameter collectionURI.
enima007 Sep 26, 2023
7cbd6dd
Fixed duplicating root collection.
enima007 Sep 26, 2023
43f331f
Fixed indentation.
enima007 Sep 26, 2023
cf1a8de
Fixed function doc.
enima007 Sep 26, 2023
1915cfa
Fixed log level and removed unecessary logs.
enima007 Sep 26, 2023
3ed9193
Removed sequenced constructor and added a new test case.
enima007 Sep 26, 2023
213d9bd
Merge branch 'feature/add-xquery-collection-create-with-just-the-path…
enima007 Sep 26, 2023
11b270b
Use ROOT_COLLECTION constant instead of /db string
enima007 Sep 27, 2023
138b435
Merge branch 'eXist-db:develop' into feature/add-xquery-collection-cr…
enima007 Oct 5, 2023
fa16fd4
Merge branch 'eXist-db:develop' into feature/add-xquery-collection-cr…
enima007 Oct 9, 2023
61faaae
Merge branch 'eXist-db:develop' into feature/add-xquery-collection-cr…
enima007 Oct 11, 2023
72bc0ee
[feature] used Automatic Resource Management to close collection.
enima007 Oct 12, 2023
bd4d1d2
[feature] Add final keyword to automatic resource management try catc…
enima007 Oct 16, 2023
b963c00
[feature] Fix creating a collection with a path not starting by /db.
enima007 Oct 16, 2023
4f71bdc
[feature] Fixed test case and added a new assert error test.
enima007 Oct 16, 2023
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
Prev Previous commit
Next Next commit
Removed sequenced constructor and added a new test case.
  • Loading branch information
enima007 committed Sep 26, 2023
commit 3ed9193c2f639352987b4428fb9a5ab87ec27504
21 changes: 14 additions & 7 deletions exist-core/src/test/xquery/xmldb/collection-create-tests.xql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:o

declare variable $t:parent-collection-name := "/parent-collection";
declare variable $t:parent-collection := "/db" || $t:parent-collection-name;
declare variable $t:path-collection := "/path/to/new-collection";
declare variable $t:path-collection := $t:parent-collection-name || "/path/to/new-collection";
declare variable $t:path-collection-from-root := "/db/path/to/new-collection-from-root";

declare
%test:setUp
Expand All @@ -38,14 +39,20 @@ function t:setup() {
declare
%test:tearDown
function t:cleanup() {
xmldb:remove($t:parent-collection)
xmldb:remove($t:parent-collection),
xmldb:remove($t:path-collection-from-root)
};

declare
%test:assertEquals("/db/path/to/new-collection")
function t:fnDocAvailableOnHiddenResource() {
%test:assertEquals("/db/parent-collection/path/to/new-collection")
function t:fnCreateNewRecursiveCollection() {
let $collection := xmldb:create-collection($t:path-collection)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that you are currently testing that:

xmldb:create-collection("/parent-collection/path/to/new-collection")

creates the collection /db/parent-collection/path/to/new-collection?

If so, that should not work! The xmldb:create-collection#1 function should always take an absolute path, i.e. starting with /db. This test should be modified to check for an error result, and the implementation updated accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

looks good to me

return (
$collection
)
return $collection
};

declare
%test:assertEquals("/db/path/to/new-collection-from-root")
function t:fnCreateNewRecursiveCollectionFromRoot() {
let $collection := xmldb:create-collection($t:path-collection-from-root)
return $collection
};