[xwiki-devs] [Rendering] WikiModel API change for merging getAttachmentURL and getImageURL?
Hi, We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class: String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters); I think we should merge them into a single method in charge of returning the URL of any resource reference: getResourceURL(ResourceReference reference, Map<String, String> parameters); Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs. The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL(). WDYT? Thanks -Vincent
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources? Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods: - getImageURL - getLinkURL (better than getAttachmentURL IMO) Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
On Wed, Oct 20, 2010 at 10:57, Vincent Massol <[email protected]> wrote:
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods:
- getImageURL - getLinkURL (better than getAttachmentURL IMO)
+1, it follows events names
Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On 10/20/2010 12:26 PM, Thomas Mortagne wrote:
On Wed, Oct 20, 2010 at 10:57, Vincent Massol<[email protected]> wrote:
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods:
- getImageURL - getLinkURL (better than getAttachmentURL IMO)
+1, it follows events names
+1 Thanks, Marius
Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 10/20/2010 10:57 AM, Vincent Massol wrote:
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods:
- getImageURL - getLinkURL (better than getAttachmentURL IMO)
I don't like getLinkURL. Link is almost a synonym of URL, so it sounds like a pleonasm a bit, at least for me. getResourceURL?
Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Oct 21, 2010, at 1:17 AM, Sergiu Dumitriu wrote:
On 10/20/2010 10:57 AM, Vincent Massol wrote:
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods:
- getImageURL - getLinkURL (better than getAttachmentURL IMO)
I don't like getLinkURL. Link is almost a synonym of URL, so it sounds like a pleonasm a bit, at least for me.
getResourceURL?
If you check the previous mails in this thread you'll see that this was my original proposal but it doesn't work since you cannot know whether a resource reference is for an image or for a link. Both Marius, Thomasn and I noticed it. As Thomas said the proposal is in line with the rest of the rendering module (different events for links and images, different renderers, etc). Thanks -Vincent
Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
On Thu, Oct 21, 2010 at 01:17, Sergiu Dumitriu <[email protected]> wrote:
On 10/20/2010 10:57 AM, Vincent Massol wrote:
On Oct 19, 2010, at 10:04 PM, Marius Dumitru Florea wrote:
On 10/19/2010 09:43 PM, Vincent Massol wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Are you going to use the current implementation of getImageURL for all ResourceType.ATTACHMENT resources?
You're right, since we have no way of differentiating links and images in ResourceReference we need to have 2 methods:
- getImageURL - getLinkURL (better than getAttachmentURL IMO)
I don't like getLinkURL. Link is almost a synonym of URL, so it sounds like a pleonasm a bit, at least for me.
As i said it follow the name of the rendering event for which it's used (begin/endLink and onImage). Also an image is a resource too, the point is to make a difference between an URL used in a link and an URL used in an image. An image is a resource too so the difference would not really make sense.
getResourceURL?
Thanks -Vincent
Thanks, Marius
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Tue, Oct 19, 2010 at 20:43, Vincent Massol <[email protected]> wrote:
Hi,
We currently have 2 methods introduced in 2.5 timeframe in the WikiModel class:
String getAttachmentURL(ResourceReference attachmentReference); String getImageURL(ResourceReference attachmentReference, Map<String, String> parameters);
I think we should merge them into a single method in charge of returning the URL of any resource reference:
How do you make the difference between a link to an attachment and an image src then ?
getResourceURL(ResourceReference reference, Map<String, String> parameters);
Note that this would assume that all references have a URL associated to them. It's not always true (it's true for documents, attachments, url, interwiki and the future icon/symbol but false for path and mailto). We could return null for resource types that have no associated URLs.
The reason I'm proposing this because in order to implement support for symbol/icon I'd need to add a new method to WikiModel: getIconURL(ResourceReference iconReference) but I feel it's better to have a single getResourceURL().
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
participants (4)
-
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol