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>

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))
- 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

Reply via email to