[xwiki-devs] XWiki tags specification
Hi devs, Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified. I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters * tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display) Optionally, we could enforce that tags can't contain white spaces. WDYT? If no one is against it then I'd like to change the UI to apply these constraints. Thanks, Marius
Hi Marius, On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case. Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above. Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance: " Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string). Thanks, Marius
Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name. Some questions: * Can the user uses quotes to enter any character, for ex " word ". Alternatively the space could be escaped with a char, for ex \ * How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name Thanks -Vincent
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma? Tags are 99% keywords and IMO it's best to establish some simple rules: * no leading or trailing spaces * no comma inside rather than implementing something that is useful in 1% of the cases. Now, I didn't started this thread to re-implement or re-design the tags UI. I just wanted to fix the current way of inputting tags which is not consistent: * regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar" * regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also. Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ". Alternatively the space could be escaped with a char, for ex \ * How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Marius, On Apr 18, 2011, at 8:38 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma?
Well we can say the exact same thing for document names... Consistency is good. Should we do the same and forbid document names with leading/trailing spaces? (it's been asked before I think, although I'm tempted to say no to this, except in UI which could trim spaces).
Tags are 99% keywords and IMO it's best to establish some simple rules:
* no leading or trailing spaces * no comma inside
rather than implementing something that is useful in 1% of the cases.
Now, I didn't started this thread to re-implement or re-design the tags UI.
It's not about UI but you *did* start the thread about starting a spec for tags and specs cannot be imprecise, they need 100% conciseness. I'm fine if we decide we'll never need to enter trailing/leading spaces nor use the separator but it has to be brought to the table and discussed, otherwise this spec will just be a joke. BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I just wanted to fix the current way of inputting tags which is not consistent:
* regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar"
* regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also.
Fixing is a different topic. This is not what you asked. You asked for a spec. Once we have defined it, then you can restrict yourself to implementing only part of it if you don't have time/will to implement it fully. My point is that the spec has to be known and since you started the spec thread we might as well brainstorm on it, no? Thanks -Vincent
Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ". Alternatively the space could be escaped with a char, for ex \ * How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
On 04/18/2011 09:49 AM, Vincent Massol wrote:
Hi Marius,
On Apr 18, 2011, at 8:38 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma?
Well we can say the exact same thing for document names... Consistency is good. Should we do the same and forbid document names with leading/trailing spaces? (it's been asked before I think, although I'm tempted to say no to this, except in UI which could trim spaces).
IMO tags are different. Page names are closer to free text.
Tags are 99% keywords and IMO it's best to establish some simple rules:
* no leading or trailing spaces * no comma inside
rather than implementing something that is useful in 1% of the cases.
Now, I didn't started this thread to re-implement or re-design the tags UI.
It's not about UI but you *did* start the thread about starting a spec for tags and specs cannot be imprecise, they need 100% conciseness.
I'm fine if we decide we'll never need to enter trailing/leading spaces nor use the separator but it has to be brought to the table and discussed, otherwise this spec will just be a joke.
I agree.
BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I see your point. I thought the separator was fixed because the UI says "Comma separated tags". I just tested and it seems pipe character | is also used as separator. If I enter "foo|bar,end" the UI displays 2 tags but the value of the XWiki.TagClass object is "foo|bar|end" (so actually I entered 3 tags). IMO the fact that you can change the separator is an implementation detail. We now use a Static List to store the list of tags but this can change. The way we store the tags shouldn't influence the way we define tags. The separator is *not* part of the tags specification because we could have an UI that allows you to input tags only one by one and we could store tags in separate fields. So IMO the specification should only say: * tags' case is used only for display * tags don't have leading or trailing spaces And in our implementation, *because* we input and store tags using a single field, we can define a separator and a way to escape that separator. I prefer comma as separator and backslash as escaping.
I just wanted to fix the current way of inputting tags which is not consistent:
* regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar"
* regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also.
Fixing is a different topic. This is not what you asked. You asked for a spec. Once we have defined it, then you can restrict yourself to implementing only part of it if you don't have time/will to implement it fully. My point is that the spec has to be known and since you started the spec thread we might as well brainstorm on it, no?
Sure. Let's see what others have to say about this. Thanks, Marius
Thanks -Vincent
Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ". Alternatively the space could be escaped with a char, for ex \ * How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
Thanks, Marius
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Apr 18, 2011, at 9:30 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:49 AM, Vincent Massol wrote:
Hi Marius,
On Apr 18, 2011, at 8:38 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
> Hi devs, > > Do we have a specification for what a tag is inside XWiki? On > http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application > tags are defined as keywords but no constraints are specified. > > I'd like to enforce this two constraints on tags: > * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma?
Well we can say the exact same thing for document names... Consistency is good. Should we do the same and forbid document names with leading/trailing spaces? (it's been asked before I think, although I'm tempted to say no to this, except in UI which could trim spaces).
IMO tags are different. Page names are closer to free text.
Tags are 99% keywords and IMO it's best to establish some simple rules:
* no leading or trailing spaces * no comma inside
rather than implementing something that is useful in 1% of the cases.
Now, I didn't started this thread to re-implement or re-design the tags UI.
It's not about UI but you *did* start the thread about starting a spec for tags and specs cannot be imprecise, they need 100% conciseness.
I'm fine if we decide we'll never need to enter trailing/leading spaces nor use the separator but it has to be brought to the table and discussed, otherwise this spec will just be a joke.
I agree.
BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I see your point. I thought the separator was fixed because the UI says "Comma separated tags". I just tested and it seems pipe character | is also used as separator. If I enter "foo|bar,end" the UI displays 2 tags but the value of the XWiki.TagClass object is "foo|bar|end" (so actually I entered 3 tags).
If you look in the class editor you should find that both comma and pipe are listed by default but you can add any number of separators or replace the default ones.
IMO the fact that you can change the separator is an implementation detail. We now use a Static List to store the list of tags but this can change. The way we store the tags shouldn't influence the way we define tags. The separator is *not* part of the tags specification because we could have an UI that allows you to input tags only one by one and we could store tags in separate fields.
Well we need to decide what we are talking about :) Are we talking about the textual format to enter tags (same as the spec for entering a document reference) or are we just talking about a single tag value. In any case we need a spec for both. Thanks -Vincent
So IMO the specification should only say:
* tags' case is used only for display * tags don't have leading or trailing spaces
And in our implementation, *because* we input and store tags using a single field, we can define a separator and a way to escape that separator. I prefer comma as separator and backslash as escaping.
I just wanted to fix the current way of inputting tags which is not consistent:
* regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar"
* regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also.
Fixing is a different topic. This is not what you asked. You asked for a spec. Once we have defined it, then you can restrict yourself to implementing only part of it if you don't have time/will to implement it fully. My point is that the spec has to be known and since you started the spec thread we might as well brainstorm on it, no?
Sure. Let's see what others have to say about this.
Thanks, Marius
Thanks -Vincent
Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ". Alternatively the space could be escaped with a char, for ex \ * How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
> * tags' case is saved but case is ignored when comparing two tags (once > you defined a tag "news" you can't define a new tag "News"; the existing > tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
> Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
> > WDYT? > > If no one is against it then I'd like to change the UI to apply these > constraints. > > Thanks, > Marius
Hi, On Mon, Apr 18, 2011 at 09:30, Marius Dumitru Florea < [email protected]> wrote:
On 04/18/2011 09:49 AM, Vincent Massol wrote:
Hi Marius,
On Apr 18, 2011, at 8:38 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote:
Hi Marius,
On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote:
> Hi devs, > > Do we have a specification for what a tag is inside XWiki? On >
http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application
> tags are defined as keywords but no constraints are specified. > > I'd like to enforce this two constraints on tags: > * tags can't have leading and trailing white space characters
I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma?
Well we can say the exact same thing for document names... Consistency is good. Should we do the same and forbid document names with leading/trailing spaces? (it's been asked before I think, although I'm tempted to say no to this, except in UI which could trim spaces).
IMO tags are different. Page names are closer to free text.
Tags are 99% keywords and IMO it's best to establish some simple rules:
* no leading or trailing spaces * no comma inside
rather than implementing something that is useful in 1% of the cases.
Now, I didn't started this thread to re-implement or re-design the tags UI.
It's not about UI but you *did* start the thread about starting a spec for tags and specs cannot be imprecise, they need 100% conciseness.
I'm fine if we decide we'll never need to enter trailing/leading spaces nor use the separator but it has to be brought to the table and discussed, otherwise this spec will just be a joke.
I agree.
I also think that trailing / leading spaces are useless in tags. They're more often a mistake than an intentional choice. Thus I'm +1 to automatically remove them and say they're not allowed as part of the tags specifications. Guillaume
BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I see your point. I thought the separator was fixed because the UI says "Comma separated tags". I just tested and it seems pipe character | is also used as separator. If I enter "foo|bar,end" the UI displays 2 tags but the value of the XWiki.TagClass object is "foo|bar|end" (so actually I entered 3 tags).
IMO the fact that you can change the separator is an implementation detail. We now use a Static List to store the list of tags but this can change. The way we store the tags shouldn't influence the way we define tags. The separator is *not* part of the tags specification because we could have an UI that allows you to input tags only one by one and we could store tags in separate fields.
So IMO the specification should only say:
* tags' case is used only for display * tags don't have leading or trailing spaces
And in our implementation, *because* we input and store tags using a single field, we can define a separator and a way to escape that separator. I prefer comma as separator and backslash as escaping.
I just wanted to fix the current way of inputting tags which is not consistent:
* regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar"
* regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also.
Fixing is a different topic. This is not what you asked. You asked for a spec. Once we have defined it, then you can restrict yourself to implementing only part of it if you don't have time/will to implement it fully. My point is that the spec has to be known and since you started the spec thread we might as well brainstorm on it, no?
Sure. Let's see what others have to say about this.
Thanks, Marius
Thanks -Vincent
Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ".
Alternatively the space could be escaped with a char, for ex \
* How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
> * tags' case is saved but case is ignored when comparing two tags (once > you defined a tag "news" you can't define a new tag "News"; the existing > tag is reused; tag's case is used only for display)
If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
Otherwise ok for me.
> Optionally, we could enforce that tags can't contain white spaces.
See above.
Thanks -Vincent
> > WDYT? > > If no one is against it then I'd like to change the UI to apply
these
> constraints. > > Thanks, > Marius
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Apr 18, 2011, at 10:33 AM, Guillaume Lerouge wrote:
Hi,
On Mon, Apr 18, 2011 at 09:30, Marius Dumitru Florea < [email protected]> wrote:
On 04/18/2011 09:49 AM, Vincent Massol wrote:
Hi Marius,
On Apr 18, 2011, at 8:38 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:14 AM, Vincent Massol wrote:
On Apr 18, 2011, at 7:27 AM, Marius Dumitru Florea wrote:
On 04/17/2011 11:02 PM, Vincent Massol wrote: > Hi Marius, > > On Apr 13, 2011, at 4:37 PM, Marius Dumitru Florea wrote: > >> Hi devs, >> >> Do we have a specification for what a tag is inside XWiki? On >>
http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application
>> tags are defined as keywords but no constraints are specified. >> >> I'd like to enforce this two constraints on tags: >> * tags can't have leading and trailing white space characters >
> I'm not sure if you mean using space as a separator or not here. If space is used as a separator then it should be allowed to use quotes (such as: "<space>*tagvalue<space>*").
Since some users want to be able to use space inside a tag, only leading and trailing space will be removed. For instance:
" Word of mouth , foo " -> 2 tags "Word of mouth" and "foo"
How do I enter leading spaces if I want? I'd like to be able to enter *any* character in any part of the tag name.
I need valid use cases. I know it's nice to be able to do everything but it's not worth to implement the quotes and the escaping character if no one will ever used them in real life. How many tags did you see with leading or trailing spaces? How many containing a comma?
Well we can say the exact same thing for document names... Consistency is good. Should we do the same and forbid document names with leading/trailing spaces? (it's been asked before I think, although I'm tempted to say no to this, except in UI which could trim spaces).
IMO tags are different. Page names are closer to free text.
Tags are 99% keywords and IMO it's best to establish some simple rules:
* no leading or trailing spaces * no comma inside
rather than implementing something that is useful in 1% of the cases.
Now, I didn't started this thread to re-implement or re-design the tags UI.
It's not about UI but you *did* start the thread about starting a spec for tags and specs cannot be imprecise, they need 100% conciseness.
I'm fine if we decide we'll never need to enter trailing/leading spaces nor use the separator but it has to be brought to the table and discussed, otherwise this spec will just be a joke.
I agree.
I also think that trailing / leading spaces are useless in tags. They're more often a mistake than an intentional choice. Thus I'm +1 to automatically remove them and say they're not allowed as part of the tags specifications.
There's a difference between a UI that trims leading/trailing spaces and the spec that says what a tag can contain. I'm +1 for the UI to trim spaces. I'm a bit less sure about the spec though. Thanks -Vincent
Guillaume
BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I see your point. I thought the separator was fixed because the UI says "Comma separated tags". I just tested and it seems pipe character | is also used as separator. If I enter "foo|bar,end" the UI displays 2 tags but the value of the XWiki.TagClass object is "foo|bar|end" (so actually I entered 3 tags).
IMO the fact that you can change the separator is an implementation detail. We now use a Static List to store the list of tags but this can change. The way we store the tags shouldn't influence the way we define tags. The separator is *not* part of the tags specification because we could have an UI that allows you to input tags only one by one and we could store tags in separate fields.
So IMO the specification should only say:
* tags' case is used only for display * tags don't have leading or trailing spaces
And in our implementation, *because* we input and store tags using a single field, we can define a separator and a way to escape that separator. I prefer comma as separator and backslash as escaping.
I just wanted to fix the current way of inputting tags which is not consistent:
* regarding leading and trailing spaces: " foo, bar" -> " foo" and "bar"
* regarding case: "foo,bar,fOo" -> removing "fOo" removes "foo" also.
Fixing is a different topic. This is not what you asked. You asked for a spec. Once we have defined it, then you can restrict yourself to implementing only part of it if you don't have time/will to implement it fully. My point is that the spec has to be known and since you started the spec thread we might as well brainstorm on it, no?
Sure. Let's see what others have to say about this.
Thanks, Marius
Thanks -Vincent
Thanks, Marius
Some questions: * Can the user uses quotes to enter any character, for ex " word ".
Alternatively the space could be escaped with a char, for ex \
* How can the user use quotes, is there an escape char, for ex: my tag with a \" * Same question for entering the tag separator character. For ex if comma is the separator, can I enter: tag with \, in the name
Thanks -Vincent
>> * tags' case is saved but case is ignored when comparing two tags (once >> you defined a tag "news" you can't define a new tag "News"; the existing >> tag is reused; tag's case is used only for display) >
> If we don't consider case I'm not sure we should use display using the first tag entered. For example someone entered "http". Someone else wants to add HTTP. Should we display http or HTTP? > I'm fine with displaying http provided the UI allows to renamed the tag case.
If you click on the tag you go to Main.Tags page where you have an option to rename the tag (that is specified in the query string).
Thanks, Marius
> > Otherwise ok for me. > >> Optionally, we could enforce that tags can't contain white spaces. > > See above. > > Thanks > -Vincent > >> >> WDYT? >> >> If no one is against it then I'd like to change the UI to apply these >> constraints. >> >> Thanks, >> Marius
On 04/18/2011 09:30 AM, Marius Dumitru Florea wrote:
On 04/18/2011 09:49 AM, Vincent Massol wrote:
BTW you haven't defined what the separator is. Is the separator the one defined in the Tag class property? If so it can be anything and there needs to be a way to enter it IMO. Imagine I choose space as the separator and I want to enter "word of mouth". I should be allowed to, either by using quotes or by escaping.
I see your point. I thought the separator was fixed because the UI says "Comma separated tags". I just tested and it seems pipe character | is also used as separator. If I enter "foo|bar,end" the UI displays 2 tags but the value of the XWiki.TagClass object is "foo|bar|end" (so actually I entered 3 tags).
IMO the fact that you can change the separator is an implementation detail. We now use a Static List to store the list of tags but this can change. The way we store the tags shouldn't influence the way we define tags. The separator is *not* part of the tags specification because we could have an UI that allows you to input tags only one by one and we could store tags in separate fields.
So IMO the specification should only say:
* tags' case is used only for display * tags don't have leading or trailing spaces
And in our implementation, *because* we input and store tags using a single field, we can define a separator and a way to escape that separator. I prefer comma as separator and backslash as escaping.
There's a difference between the separator used in the display, and the separator used internally. In the UI, the only separator is the comma, which is hard-coded in documentTags.vm. The tag plugin takes care of escaping the pipe symbol. Note that updating the tags using the tag input displayed in edit mode will explode the tags containing a pipe (we should remove the tag input in edit mode). In the database, | is the only separator, and it can't easily be changed. Also, | used inside values is automatically escaped with \| in the database. The current implementation doesn't support escapes in the UI, but this could be changed if we decide on an escape character. See com.xpn.xwiki.objects.classes.ListClass.getListFromString(String, String, boolean) -- Sergiu Dumitriu http://purl.org/net/sergiu/
On 04/13/2011 04:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
+1.
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
+0. To answer Vincent's problem, changing the case of a tag could be done via the tag rename. What would happen with case sensitivity? For example, renaming http into HTTP while Http exists, should Http be changed to HTTP as well, or only exact, case-sensitive matches of http be renamed?
Optionally, we could enforce that tags can't contain white spaces.
-1.
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Apr 18, 2011, at 8:59 AM, Sergiu Dumitriu wrote:
On 04/13/2011 04:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
+1.
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
+0.
To answer Vincent's problem, changing the case of a tag could be done via the tag rename.
Yes I know but I didn't test if it works with case sensitivity.
What would happen with case sensitivity?
For example, renaming http into HTTP while Http exists, should Http be changed to HTTP as well, or only exact, case-sensitive matches of http be renamed?
Good question, behavior to be decided. Thanks -Vincent
Optionally, we could enforce that tags can't contain white spaces.
-1.
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
On 04/18/2011 09:59 AM, Sergiu Dumitriu wrote:
On 04/13/2011 04:37 PM, Marius Dumitru Florea wrote:
Hi devs,
Do we have a specification for what a tag is inside XWiki? On http://extensions.xwiki.org/xwiki/bin/view/Extension/Tag+Application tags are defined as keywords but no constraints are specified.
I'd like to enforce this two constraints on tags: * tags can't have leading and trailing white space characters
+1.
* tags' case is saved but case is ignored when comparing two tags (once you defined a tag "news" you can't define a new tag "News"; the existing tag is reused; tag's case is used only for display)
+0.
To answer Vincent's problem, changing the case of a tag could be done via the tag rename. What would happen with case sensitivity?
For example, renaming http into HTTP while Http exists, should Http be changed to HTTP as well, or only exact, case-sensitive matches of http be renamed?
I think Http should be changed as well because it means the same thing. Displaying the same (-semantically) tag in different ways is confusing. I prefer consistency. Thanks, Marius
Optionally, we could enforce that tags can't contain white spaces.
-1.
WDYT?
If no one is against it then I'd like to change the UI to apply these constraints.
participants (4)
-
Guillaume Lerouge -
Marius Dumitru Florea -
Sergiu Dumitriu -
Vincent Massol