[xwiki-devs] [PROPOSAL] Change default resolver to used in model ScriptService
Hi devs, Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document. So I propose to change the default resolver to "current". Here is my +1. This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it. -- Thomas Mortagne
On Tue, Feb 19, 2013 at 2:38 PM, Thomas Mortagne <[email protected]>wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
Obviously, I am +1 since I have just face the issue which cause Thomas to open this thread. This script service is not much used yet, I doubt anybody is using it
expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
I am not sure you are right here. The shorter we leave it like it is, the less chance we have to break someone. So, I would be in favor of considering this a bug, and fixing it in 4.5.1.
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO
+0 Thanks, Marius On Tue, Feb 19, 2013 at 3:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Feb 19, 2013, at 2:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet,
I don't think this is fully true. I've seen it used in quite a few extensions and I know XWiki SAS is using it a bit everywhere too on their client projects.
I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
It's going to break a few places for sure but I'd say it's acceptable. I think we should: 1) Do a quick review of places where we use it in *.vm and *.xml files in xwiki-platform to ensure it's ok 2) Make sure it's mentioned in the RN of 5.0 in the backward compat section 3) Update the "currentmixed" resolver javadoc to mention to not use it except for blah blah… So here's my +1 to do this in 5.0 provided we do these 3 points. Thanks -Vincent
No one against, applied on master. I'm -0 (behaviour change) to apply it on 4.5 branch but will apply it if there is other people who agree with Denis on this part. On Tue, Feb 19, 2013 at 2:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
-- Thomas Mortagne
-- Thomas Mortagne
On Wed, Feb 20, 2013 at 12:23 PM, Thomas Mortagne <[email protected]
wrote:
No one against, applied on master.
I'm -0 (behaviour change) to apply it on 4.5 branch but will apply it if there is other people who agree with Denis on this part.
Does it make sense that $services.model.resolveAttachment("myfile.png") gives "[email protected]" and not "[email protected]" ? The same for resolveObject. I agree that there may have been a tricky usage of $services.model.resolveDocument("") that currently give "currentSpace.WebHome" and will give "currentSpace.currentPage" with this change. I am still convinced that more we wait, more we have our users confused. This is a bug, and we should fix it ASAP.
On Tue, Feb 19, 2013 at 2:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
-- Thomas Mortagne
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO
On Feb 20, 2013, at 12:35 PM, Denis Gervalle <[email protected]> wrote:
On Wed, Feb 20, 2013 at 12:23 PM, Thomas Mortagne <[email protected]
wrote:
No one against, applied on master.
I'm -0 (behaviour change) to apply it on 4.5 branch but will apply it if there is other people who agree with Denis on this part.
Does it make sense that $services.model.resolveAttachment("myfile.png") gives "[email protected]" and not "[email protected]" ? The same for resolveObject.
I agree that there may have been a tricky usage of $services.model.resolveDocument("") that currently give "currentSpace.WebHome" and will give "currentSpace.currentPage" with this change.
I am still convinced that more we wait, more we have our users confused. This is a bug, and we should fix it ASAP.
+0 to backport in 4.5 Thanks -Vincent
On Tue, Feb 19, 2013 at 2:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
-- Thomas Mortagne
For the record, this change breaks the links in the Watch List live table from the user profile. XWiki.XWikiUserWatchListLiveTableResults, which feeds the live table, uses: $services.model.createDocumentReference($wiki, '', '') and $services.model.createDocumentReference($wiki, $spaceName, '') to get the reference to the wiki/space home page. I'm going to update this page. Thanks, Marius On Wed, Feb 20, 2013 at 1:23 PM, Thomas Mortagne <[email protected]> wrote:
No one against, applied on master.
I'm -0 (behaviour change) to apply it on 4.5 branch but will apply it if there is other people who agree with Denis on this part.
On Tue, Feb 19, 2013 at 2:38 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Right now the model script service use "currentmixed" as default resolver and it should use "current" one IMO: 1) it's behavior is not very clear for a newcomer 2) it's pretty much unusable for attachments
The difference between the two resolver is that "currentmixed" resolve document name beased on default (WebHome) instead of current document. AFAIK this resolver as been introduced for retro compatibility purpose because in some old APIs like XWikiDocument contructors the document name was resolver as WebHome and not based on the current document.
So I propose to change the default resolver to "current".
Here is my +1.
This script service is not much used yet, I doubt anybody is using it expecting to get WebHome when resolving the document name but since it's a behaviour change 5.0 is the right time for it.
-- Thomas Mortagne
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (4)
-
Denis Gervalle -
Marius Dumitru Florea -
Thomas Mortagne -
Vincent Massol