Hi Stephane and all,
On 7 Aug 2019, at 14:22, Stéphane Laurière
<slauriere(a)xwiki.com> wrote:
Hi everyone,
I'm following up on a thread started in 2015 about the best practices regarding app
pages organization:
-
https://xwiki.markmail.org/message/657vcm6ylkz4yytc
-
https://dev.xwiki.org/xwiki/bin/view/Community/ApplicationDevelopmentBestPr…
In this thread, the idea of introducing a dedicated common root area for all application
technical pages was suggested by Denis:
https://xwiki.markmail.org/message/kk5l3dwjmpfelkzp
I'm wondering why this idea was not pushed further (it's not strictly
incompatible with the current best practices, but most of the recent applications have
their top level area, except a few like Notifications or ChartJS).
Indeed, right now, the best practice is a top level space named after the app
(
https://dev.xwiki.org/xwiki/bin/view/Community/ApplicationDevelopmentBestPr…).
I guess the reason we didn’t do anything else is because we lacked an agreed proposal
simply.
Comparing with how other platforms do is inspirational
(Microsoft Windows "Program Files" was mentioned in the thread). On Debian, the
Maven package is installed in /usr/share/maven/ while files used and produced by Maven can
be located anywhere. Along the same line, I would see as a user and developer experience
improvement if we had the following structure:
1) Code:
XWiki
|- MyApp
|- MyAppClass
|- MyAppSheet
|- …
I don’t think it’s a good idea to put the apps directly under the XWiki space. I feel it
would be better to have an “Applications” subspace as in:
XWiki
|_ Applications
|_ MyApp
|_ …
|_ Users
|_ …
This allows to put other things in the XWiki space, such as users for example.
Note that for me the main reason to avoid putting spaces at the root is to avoid using up
namespaces that can then no longer be used by users. In this spirit the minimum we could
do is reserve only the “XWiki” space.
2) Data: the pages created by MyApp could then
typically be located by default in a MyApp space at the root of the wiki, the user could
however choose which default space to use, or leave it empty (then the space from where
the user fires the create action could be used, for instance, or any scriptable rule).
Why not. I’m just not sure I would mix app data pages with pure content pages and use up
namespaces at the root (you end up with the same issue as I mentioned above and you
below). I agree that data pages shouldn’t go in the /XWiki/Applications space though which
should be readonly.
So there are some other options:
* In /XWiki/Data/MyApp
* Reserve another namespace entry at the root (“Data”): /Data/MyApp
You said " the user could however choose which default space to use”. How would you
plan to implement this? Right now, this would work only if the app provides a template and
the user uses this template to create a new page. For example the FAQ app doesn’t do that
and it provides a UI to create a new FAQ entry and this goes in /FAQ/ directly.
Another issue I see with the current practice (raised by Clément A. orally) is that some
application names may conflict with names the user would like to use for content that is
not strictly related to the app. Not necessarily a big deal with one thousand of
applications, but might become one with more, wouldn't it?
Sure and you get the same issue with your proposal of putting app data at the root under
/MyApp, no?
I understand that the layout proposed above would
raise technical issues (XWiki space permissions for instance, mentionned in the 2015
thread, and others), however what's your view on it from a design perspective? (sorry
if I overlooked strong arguments already expressed against it)
Thanks for starting this thread again.
One other point missing in this discussion is the migration from the current status to any
target. How would we achieve it? How do we migrate an app to follow any new best practice
without breaking users? (Idea:
https://design.xwiki.org/xwiki/bin/view/Proposal/DocumentAliases).
Let’s start the discussion ;)
Thanks
-Vincent
Cheers
Stéphane