Like Edy, I'm not a big fan of the forced document based entry point
since it might not makes any sense for some use cases.

Now one job of the tmp resource is also to check access right so we
need to pass it an entity reference on which to test the right when a
right check is required. The alternative being to end up with the
reference both in the path (to avoir collisions) and as some URL
parameter which is not nice I guess what you propose it ok as long as
empty reference is supported (i.e. don't test the right and just go
return the file associated to the path) as in
http://mydomain/xwiki/tmp/mymodule//I/don't/care/about/right.png

Making the tmp resource generic enough to be just an entry point for
calling some module which then do whatever it wants would just be a
duplicate of resource handler framework but maybe we just don't really
need this anymore central temp resource entry point since now that we
have a generic resource handler framework ?

On Fri, Apr 15, 2016 at 9:26 AM, Vincent Massol <[email protected]> wrote:
> @Thomas: are you ok with the proposed format:
>
> http://<server>/<context>/tmp/<module id>/<serialized owner document 
> reference>/<module-dependent resource path>
>
> ?
>
> Thanks
> -Vincent
>
>> On 14 Apr 2016, at 17:55, Thomas Mortagne <[email protected]> wrote:
>>
>> On Thu, Apr 14, 2016 at 4:52 PM, Marius Dumitru Florea
>> <[email protected]> wrote:
>>> On Thu, Apr 14, 2016 at 5:43 PM, Vincent Massol <[email protected]> wrote:
>>>
>>>> Hi devs,
>>>>
>>>> I’m implementing http://jira.xwiki.org/browse/XWIKI-10375 ("Refactor the
>>>> temporary resource concept inside the Resource module”) and I need to
>>>> define a URL format for the new “tmp” resource type.
>>>>
>>>> I’m proposing the following:
>>>>
>>>>
>>>
>>>> http://<server>/<context>/tmp/<module id>/<serialized owner document
>>>> reference>/<module-dependent resource path>
>>>>
>>>
>>> Serialized document reference uses backslash to escape special characters
>>> which breaks the URL in Tomcat for security reasons.
>>
>> Badly configured Tomcat does not like slash but are you sure about backslash 
>> ?
>>
>>>
>>>
>>>>
>>>> This is based on the existing TemporaryResourceReference at:
>>>>
>>>> https://github.com/xwiki/xwiki-platform/blob/96caad053c14fc5546e9bc141bc284e6112dd48e/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-default/src/main/java/org/xwiki/resource/temporary/TemporaryResourceReference.java#L33-L33
>>>>
>>>> For example:
>>>>
>>>> http://
>>>> <server>/<context>/tmp/officeviewer/A.B.WebHome/Q29tcGFueSBQcmVzZW50YXRpb24ucHB0/Company+Presentation-slide0.jpg
>>>>
>>>> Note that in this example from the officeviewer macro the module-dependent
>>>> resource path consists in:
>>>>
>>>
>>>
>>>> - base64(name of office attachment + hashcode(parameters))
>>>>
>>>
>>> See http://jira.xwiki.org/browse/XWIKI-11528 for the rationale behind it. I
>>> was trying to avoid backslash (from the serialized attachment reference) in
>>> the URL.
>>>
>>>
>>>> - generated image name from PPT
>>>>
>>>> In this case, the implementation would generate the following file:
>>>>
>>>>
>>>> [TMPDIR]/officeviewer/A/B/WebHome/Q29tcGFueSBQcmVzZW50YXRpb24ucHB0/Company+Presentation-slide0.jpg
>>>>
>>>> WDYT?
>>>>
>>>> Thanks
>>>> -Vincent
>>>>
>>>> _______________________________________________
>>>> devs mailing list
>>>> [email protected]
>>>> http://lists.xwiki.org/mailman/listinfo/devs
>>>>
>>> _______________________________________________
>>> devs mailing list
>>> [email protected]
>>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>>
>>
>> --
>> Thomas Mortagne
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs



-- 
Thomas Mortagne
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to