[xwiki-devs] [VOTE] Refactoring of the image/link xwiki syntax 2.0 to be more generic
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. Here's my +1 WDYT? Thanks -Vincent
On Fri, Mar 6, 2009 at 13:30, Vincent Massol <[email protected]> wrote:
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:
https
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.
Here's my +1
+1
WDYT?
Thanks -Vincent _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Vincent Massol wrote:
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.
Here's my +1
+1 What's the cost of changing the wiki separator to ::, as in doc:mywiki::Space.Document? -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Mar 6, 2009, at 2:47 PM, Sergiu Dumitriu wrote:
Vincent Massol wrote:
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.
Here's my +1
+1
What's the cost of changing the wiki separator to ::, as in doc:mywiki::Space.Document?
From a rendering module perspective, it's 0 cost. The whole content is considered a doc name and passed as is to the Document Access Bridge. Thanks -Vincent
Vincent Massol wrote:
On Mar 6, 2009, at 2:47 PM, Sergiu Dumitriu wrote:
Vincent Massol wrote:
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.
Here's my +1
+1
What's the cost of changing the wiki separator to ::, as in doc:mywiki::Space.Document?
From a rendering module perspective, it's 0 cost. The whole content is considered a doc name and passed as is to the Document Access Bridge.
In the bridge for the moment it would suffice to do a replace("::", ":"). What are the changes in the WYSIWYG? -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote: [snip]
What's the cost of changing the wiki separator to ::, as in doc:mywiki::Space.Document? From a rendering module perspective, it's 0 cost. The whole content is considered a doc name and passed as is to the Document Access Bridge.
In the bridge for the moment it would suffice to do a replace("::", ":"). What are the changes in the WYSIWYG?
AFAIK all URLs are computed on the server side, using XWiki API. The WYSIWYG is not aware of the document name syntax. Marius
Marius Dumitru Florea wrote:
Sergiu Dumitriu wrote: [snip]
What's the cost of changing the wiki separator to ::, as in doc:mywiki::Space.Document? From a rendering module perspective, it's 0 cost. The whole content is considered a doc name and passed as is to the Document Access Bridge.
In the bridge for the moment it would suffice to do a replace("::", ":"). What are the changes in the WYSIWYG?
AFAIK all URLs are computed on the server side, using XWiki API. The WYSIWYG is not aware of the document name syntax.
URLs are computed on server side but references are built on the Wysiwyg side, so it would need some changes, not costly, though, atmost a couple of hours. We don't have tests for multiwiki at all however and we'd need to test that manually. Which reminds me we need to test the multiwiki support thoroughly as it is. Happy coding, Anca
Marius _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Vincent Massol wrote:
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:).
I wish we wouldn't need to have relative URIs (returned by $xwiki.getURL()) always prefixed by the http: prefix. Could we try to detect it's a relative URI? (that it starts with /)
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.
Here's my +1
WDYT?
+1 otherwise it looks good, especially for the fact that we add more power without changing current behaviour. Happy coding, Anca
Thanks -Vincent _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Vincent Massol wrote:
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
In some cases (proxy + URL rewriting) they are not relative. See http://jira.xwiki.org/jira/browse/XWIKI-3159
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.
Here's my +1
+1 Thanks, Marius
WDYT?
Thanks -Vincent _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (5)
-
Anca Paula Luca -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol