[xwiki-devs] [Nested Spaces] Database Model design and issues
Hi Devs, At http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HDatabaseModel I have started drafting some naive impl for Nested Spaces. I believe Edy has provided some other links with probably more elaborate algorithms that we should study (such as http://www.slideshare.net/billkarwin/models-for-hierarchical-data). In any case I’ve also started a Problem section at http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HProblems where I’ve listed one item FTM. I’m pasting it here: “ * For ex if you do HQL (or you use an extension that does) like {{code}}where doc.space = 'somespace'{{/code}} and add a parent or child Space for ##somespace## then the query will not return anything anymore since you can have something like ##parent.somespace.child## in the DB in the ##space## column (since we store the full space reference in there for NS). ** Solution 1: Rewrite the queries to use something like {{code}}where doc.space = 'somespace' or doc.space like '%.somespace'{{/code}}. ** Solution 2: Don't modify the ##space## column and add a ##spaceReference## one. This is not perfect in case there are several spaces named ##somespace## ** Solution 3: ?? “ I’d be curious to know what you think about it and if you have ideas. Feel free to list other problems you can see there and your ideas for solving them. Thanks -Vincent
On Sat, Jun 13, 2015 at 10:53 AM, [email protected] <[email protected]> wrote:
Hi Devs,
At http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HDatabaseModel I have started drafting some naive impl for Nested Spaces. I believe Edy has provided some other links with probably more elaborate algorithms that we should study (such as http://www.slideshare.net/billkarwin/models-for-hierarchical-data).
In any case I’ve also started a Problem section at http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HProblems where I’ve listed one item FTM. I’m pasting it here:
“ * For ex if you do HQL (or you use an extension that does) like {{code}}where doc.space = 'somespace'{{/code}} and add a parent or child Space for ##somespace## then the query will not return anything anymore since you can have something like ##parent.somespace.child## in the DB in the ##space## column (since we store the full space reference in there for NS). ** Solution 1: Rewrite the queries to use something like {{code}}where doc.space = 'somespace' or doc.space like '%.somespace'{{/code}}. ** Solution 2: Don't modify the ##space## column and add a ##spaceReference## one. This is not perfect in case there are several spaces named ##somespace## ** Solution 3: ?? “
This use case does not really make much sense, you want to get the documents located in a specific space but I don't see why anyone would want to get all the documents located in a space anywhere that happen to have a reference ending with "somespace".
I’d be curious to know what you think about it and if you have ideas.
Feel free to list other problems you can see there and your ideas for solving them.
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On 13 Jun 2015 at 11:51:25, Thomas Mortagne ([email protected](mailto:[email protected])) wrote:
On Sat, Jun 13, 2015 at 10:53 AM, [email protected] wrote:
Hi Devs,
At http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HDatabaseModel I have started drafting some naive impl for Nested Spaces. I believe Edy has provided some other links with probably more elaborate algorithms that we should study (such as http://www.slideshare.net/billkarwin/models-for-hierarchical-data).
In any case I’ve also started a Problem section at http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HProblems where I’ve listed one item FTM. I’m pasting it here:
“ * For ex if you do HQL (or you use an extension that does) like {{code}}where doc.space = 'somespace'{{/code}} and add a parent or child Space for ##somespace## then the query will not return anything anymore since you can have something like ##parent.somespace.child## in the DB in the ##space## column (since we store the full space reference in there for NS). ** Solution 1: Rewrite the queries to use something like {{code}}where doc.space = 'somespace' or doc.space like '%.somespace'{{/code}}. ** Solution 2: Don't modify the ##space## column and add a ##spaceReference## one. This is not perfect in case there are several spaces named ##somespace## ** Solution 3: ?? “
This use case does not really make much sense, you want to get the documents located in a specific space but I don't see why anyone would want to get all the documents located in a space anywhere that happen to have a reference ending with "somespace”.
Indeed, after more thinking and trying to find real use cases, I couldn’t find any valid one. Thus this issue is more suite for the migration guide and I’ve put it there at http://design.xwiki.org/xwiki/bin/view/Proposal/NestedSpaces#HMigrationGuide Thanks -Vincent
I’d be curious to know what you think about it and if you have ideas.
Feel free to list other problems you can see there and your ideas for solving them.
Thanks -Vincent
participants (2)
-
Thomas Mortagne -
vincent@massol.net