Details
-
Improvement
-
Resolution: Fixed
-
Major
-
1.8.1, 1.9 M1
-
None
-
syntax21
-
Unit, Integration
-
Description
See http://markmail.org/thread/q44fc6mralyoyks5 for full details.
Hi devs, Someone on the list asked how create a link and an image pointing to a relative reference (that he got using one of XWiki's API since they all return relative URL). We currently don't have a good solution for this and I'd like to propose a solution. For links ======= Make the usage of a prefix that specifies what comes next a generic feature. We have the following needs: * link to a URL * link to a relative path * link to a document * link to a mailto * link to an attachment I propose the following syntax: [[label>>prefix:value]] where prefix = one of http:, path:, doc:, mailto:, attach: In addition I propose that when there's no prefix or if the prefix is an unknown prefix then to consider that the reference is a reference to a document (equivalent to doc:). Pros: * Generic * Ability to add more prefixes later on (for ex ftp:) * Ability to have virtual wikis which have "reserved" names such as "doc", "http", "ftp", "mailto", etc since you can write [[doc:doc:Space.Page]] * Ability to write shorthand for documents in the text, such as: "This is a link doc:Space.Page" * Ability to reference relative paths and write stuff such as {{velocity}}[[label>>path:$xwiki.getURL(something)]]{{/velocity}} For images ========= * Similar to links add the ability to add prefixes in a generic way. We have the following needs: * image where the source is at a URL * image where the source is at a relative path * image where the source is in a document I propose the following syntax: image:prefix:value where prefix = one of http:, path:, attach: Note that we already support image:http://... so the proposal here is simply to make it generic. In addition I propose that when there's no prefix or if the prefix is unknown then to consider that the image is to be found in a document (equivalent to attach:). Same pros as above.
Thomas rightly pointed that https prefix must be supported too by default.
Attachments
Issue Links
- depends on
-
XWIKI-5486 Make link reference syntax more generic and extensible
- Closed
- is duplicated by
-
XWIKI-4768 xwiki.getURL("Space.Page", "delete") doesn't generate URL like /xwiki/bin/delete/Space/Page
- Closed
-
XWIKI-3999 Allow image macros to refer to other images on the server by allowing an initial /
- Closed
- relates to
-
XWIKI-5554 Generalize Image support and add relative paths support for XWiki Syntax 2.1
- Closed