Hi All,
Sorry about digging this up now but I need this if I'm to get started with
officepreview integration.
How about this kind of URL?
/xwiki/bin/tempresource/Space/Document/plugin/Sjqh73sjq.png
where plugin is the name of the plugin/component that generated the
image, like svg, chart, graphviz...
Sounds good to me for a first version.
I'd suggest instead to use the shorter "tmp" to make the URL smaller
and be aligned with other action names:
/xwiki/bin/tmp/<space>/<page>/<module name>/<resource name>
One small remark: in officeimporter we need to be capable of previewing
multiple attachments on the same document. And to make things worse, each
attachment might be exploded into multiple artifacts (image files). So the
trailing <resource name> segment of above URL might pose collision issues.
There are two ways to avoid this:
1. Make sure <resource name> is unique for each image file generated (UUID).
2. Change the URL to something like below:
/xwiki/bin/tmp/<space>/<page>/<module name>/path/to/resource
Now, about protecting against a user simply changing <space> and <page>
segments of above URL and getting access to a file to which he should not
have access:
We can organize the files inside working directory so that the internal path
starts with something like $WORK_DIR/wiki/space/page? or even
$WORK_DIR/SHA_1(wiki)/SHA_1(space)/SHA_1(page)? (in case if there needs to
be some cleaning of wiki,space or page names)
I'm only thinking out lound here and would like your comments on this. We
really need this functionality asap.
Thanks.
- Asiri
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs