On 03/29/2016 11:32 AM, Vincent Massol wrote:
> 
>> On 29 Mar 2016, at 16:53, Vincent Massol <vinc...@massol.net> wrote:
>>
>>
>>> On 29 Mar 2016, at 16:46, Sergiu Dumitriu <ser...@xwiki.org> wrote:
>>>
>>> It is working, but only if the default action is missing as well. So
>>> indeed /bin/view/Page doesn't work ('view' is considered the space), but
>>> /bin/Page does work. And as far as I know, it always worked this way.
>>
>> Ok, thanks for remembering this! So only when xwiki.showviewaction=0
>>
>>> When not considering nested spaces, I'm -0 for its removal, it's a
>>> setting that's useful for shorter URLs in a mostly read only site (e.g.
>>> public website).
>>
>> Only if you put your documents in the Main space… If you need short URLs 
>> it’s better to use a shorturl strategy as described at 
>> http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs (notice that 
>> xwiki.usedefaultweb is not even mentioned there).
>>
>>> I don't have a clear grasp of how nested spaces work,
>>> so I'm not sure how this setting affects nested spaces.
>>
>> I’ll do some tests but I’m pretty sure that the combination of 
>> xwiki.showviewaction=1 + xwiki.usedefaultweb=1 + Nested Pages is not 
>> currently working.
> 
> So indeed this got broken in 7.2M1 when we refactored URL parsing for Nested 
> Spaces/Pages (XWIKI-12169).
> 
> The problem is that this conflicts with the strategy we’ve used to access top 
> level Nested Pages. In the URL parsing code we have:
> 
> // Normally the last segment is always the page name but we want to handle a 
> special case when we
> // have "/view/something" and we wish in this case to consider that 
> "something" is the space. This
> // is to handle Nested Documents, so that the user can have a top level 
> Nested Document
> // (something.WebHome) and access it from /view/something. If we didn't 
> handle this special case
> // the user would get Main.something and thus wouldn't be able to access 
> something.WebHome. He'd
> // need to use /view/something/ which is not natural in the Nested Document 
> mode.
> 
> So right now when we see /bin/view/something or /bin/something, we consider 
> “something” to be the space name and the page is “WebHome”.
> 
> So this conflicts with the previous behavior of xwiki.usedefaultweb=1 & 
> xwiki.showviewaction=0
> 
> We need to decide what we want. I personally prefer removing 
> xwiki.usedefaultweb which was already strange (since it worked only with  
> xwiki.showviewaction and only shortens URLs if the doc is in the Main space) 
> and keep the ability to access top-level Nested Documents easily.
> 
> WDYT?

Sounds good, +1. There was an old issue, debating whether /bin/Something
should resolve to Something.WebHome or Main.Something, and the popular
opinion was Something.WebHome, so it's good that this was finally solved.

http://jira.xwiki.org/browse/XWIKI-4643
http://jira.xwiki.org/browse/XWIKI-3844

> Thanks
> -Vincent
> 
> 
>> Thanks
>> -Vincent
>>
>>> On 03/29/2016 09:35 AM, Vincent Massol wrote:
>>>> Hi devs,
>>>>
>>>> I was reading the comment from Marius on 
>>>> https://jira.xwiki.org/browse/XWIKI-13223 and indeed it seems that the 
>>>> “xwiki.usedefaultweb” config parameter has not been working for a very 
>>>> long time (Marius says at least before 2.7). Locally I’ve tested a 5.2.4 
>>>> version and indeed it’s not working.
>>>>
>>>> For Main.AllDocs the generated URL is:
>>>> http://localhost:8080/xwiki/bin/view/AllDocs
>>>>
>>>> Maybe at some point we were counting the number of path segments after the 
>>>> action and if it was 1 and xwiki.usedefaultweb was set to true we would 
>>>> add “Main” as the space. 
>>>>
>>>> However that’s not the case in XWiki 5.2.4 and probably earlier.
>>>>
>>>> In addition, with Nested Pages we’ve implemented the support of a single 
>>>> path element after the action. FTR, from 
>>>> BinEntityResourceReferenceResolverTest:
>>>>
>>>> // Test when single space segment, to be Nested Document friendly.
>>>> // Normally the last segment is always the page name but we want to handle 
>>>> a special case when we
>>>> // have "/view/something" and we wish in this case to consider that 
>>>> "something" is the space. This
>>>> // is to handle Nested Documents, so that the user can have a top level 
>>>> Nested Document
>>>> // (something.WebHome) and access it from /view/something. If we didn't 
>>>> handle this special case
>>>> // the user would get Main.something and thus wouldn't be able to access 
>>>> something.WebHome. He'd
>>>> // need to use /view/something/ which is not natural in the Nested 
>>>> Document mode.
>>>> testCreateResource("http://localhost/bin/space";, "view",
>>>>   buildEntityReference("wiki", Arrays.asList("space"), null), 
>>>> fullSingleSpaceReference, EntityType.DOCUMENT);
>>>>
>>>> I also don’t think it’s a big help for users to be able to omit the Main 
>>>> space since they need to keep the other spaces in the URL anyway.
>>>>
>>>> So I’m proposing to officially drop support for this parameter and remove 
>>>> it from xwiki.cfg since it has not worked for ages.
>>>>
>>>> WDYT? Have I missed something?
>>>>
>>>> Thanks
>>>> -Vincent
>>>>

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu
_______________________________________________
devs mailing list
devs@xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to