[xwiki-devs] [VOTE] Move Tag pages to their own app + xwiki-tag-plugin
Hi, I'd like to move Tags related pages to their own app: xwiki-application-tag. I'd also like to commit a small plugin that allows to manipulate tags easily. It also avoid the need of programming rights on pages Tags and TagsRss. The application and the plugin would have the same release cycle and would be included in xwiki enterprise (like skinx or watchlist plugins/apps). This also mean that we'll have a tag application in JIRA. Tag pages : - Main.TagCloud - Main.Tags - Main.TagsRss - XWiki.TagClass Tag plugin API : public List<String> getTags(boolean distinct); public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag); Here's my +1. JV.
+1 -Vincent On Jan 20, 2009, at 5:39 PM, Jean-Vincent Drean wrote:
Hi,
I'd like to move Tags related pages to their own app: xwiki- application-tag. I'd also like to commit a small plugin that allows to manipulate tags easily. It also avoid the need of programming rights on pages Tags and TagsRss. The application and the plugin would have the same release cycle and would be included in xwiki enterprise (like skinx or watchlist plugins/ apps). This also mean that we'll have a tag application in JIRA.
Tag pages :
- Main.TagCloud - Main.Tags - Main.TagsRss - XWiki.TagClass
Tag plugin API :
public List<String> getTags(boolean distinct); public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
Here's my +1.
JV.
Jean-Vincent Drean wrote:
Hi,
I'd like to move Tags related pages to their own app: xwiki-application-tag. I'd also like to commit a small plugin that allows to manipulate tags easily. It also avoid the need of programming rights on pages Tags and TagsRss. The application and the plugin would have the same release cycle and would be included in xwiki enterprise (like skinx or watchlist plugins/apps). This also mean that we'll have a tag application in JIRA.
Tag pages :
- Main.TagCloud - Main.Tags - Main.TagsRss - XWiki.TagClass
Tag plugin API :
public List<String> getTags(boolean distinct); public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag);
Will come handy :)
public boolean deleteTag(String tag);
Here's my +1.
+1 Jerome
JV. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Tue, Jan 20, 2009 at 5:39 PM, Jean-Vincent Drean <[email protected]> wrote:
Hi,
I'd like to move Tags related pages to their own app: xwiki-application-tag. I'd also like to commit a small plugin that allows to manipulate tags easily. It also avoid the need of programming rights on pages Tags and TagsRss. The application and the plugin would have the same release cycle and would be included in xwiki enterprise (like skinx or watchlist plugins/apps). This also mean that we'll have a tag application in JIRA.
Tag pages :
- Main.TagCloud - Main.Tags - Main.TagsRss - XWiki.TagClass
Tag plugin API :
public List<String> getTags(boolean distinct);
Why boolean distinct ?
public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
Here's my +1.
+1 for moving Tag related pages in its own application.
JV. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Tue, Jan 20, 2009 at 5:48 PM, Thomas Mortagne <[email protected]> wrote:
public List<String> getTags(boolean distinct);
Why boolean distinct ?
To be able to get every occurence of every tag when needed (like in the tag cloud). I could add a getTags() method to ease the most common usage (getting on entry per different tag in the wiki). WDYT ?
public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
JV.
On Tue, Jan 20, 2009 at 6:11 PM, Jean-Vincent Drean <[email protected]> wrote:
On Tue, Jan 20, 2009 at 5:48 PM, Thomas Mortagne <[email protected]> wrote:
public List<String> getTags(boolean distinct);
Why boolean distinct ?
To be able to get every occurence of every tag when needed (like in the tag cloud). I could add a getTags() method to ease the most common usage (getting on entry per different tag in the wiki). WDYT ?
Wouldn't public List<String> getTagsNames(); public Map<String, Integer> getTagsOccurences(); or something similar be better ? the List<String> is difficult to use to count occurrences and also it could be very big if tags are used a lots in the wiki.
public List<String> getPagesWithTag(String tag); public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
JV. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Jean-Vincent Drean wrote:
Hi,
I'd like to move Tags related pages to their own app: xwiki-application-tag. I'd also like to commit a small plugin that allows to manipulate tags easily. It also avoid the need of programming rights on pages Tags and TagsRss. The application and the plugin would have the same release cycle and would be included in xwiki enterprise (like skinx or watchlist plugins/apps). This also mean that we'll have a tag application in JIRA.
+1, with the remarks below:
Tag pages :
- Main.TagCloud - Main.Tags - Main.TagsRss - XWiki.TagClass
Tag plugin API :
public List<String> getTags(boolean distinct);
Is this global? I mean, does it get all tags found in the wiki, or just the tags for the current document? I'd like to also have a method to get tags for a document (+ for translations), since the getTags method does not belong to the Document class (although it is part of the current API, I'd like to see it removed in the new model). Maybe we should deprecate it after we add this plugin/application. What does "distinct" do? I'd rather have a caseSensitive parameter, or different methods for this.
public List<String> getPagesWithTag(String tag);
Pages? This is not our terminology.
public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
What happens when the user does not have the right to alter all the documents, only some of them? Will the changes appear in whatsnew? Will they create new versions? Will they change the author? We'd also need a method to get all tags with their occurrence count (for the tag cloud). So, how about this API: - List<String> getAllTags() -> all wiki tags, case insensitive (CI) - List<String> getAllTags(boolean caseInsensitive) -> all tags - HashMap<String, Integer> getTagCount() -> all wiki tags with occurrence, CI - HashMap<String, Integer> getTagCount(boolean caseInsensitive) -> all wiki tags with occurrence - List<String> getTagsForDocument(Document doc) -> document tags --> Debate: XWikiDocument, Document or String? Or all? - boolean addTagToDocument(String tag, Document doc) -> returns true if the tag was successfully added, false if the tag was already associated. Throws exceptions in other cases (not enough rights, db issues, etc). - boolean removeTagFromDocument(String tag, Document doc) -> returns true if the tag was successfully removed, false if the tag was not associated. Throws exceptions in other cases (not enough rights, db issues, etc). - public List<String> getDocumentsWithTag(String tag) - public boolean renameTag(String tag, String newTag) - public boolean deleteTag(String tag) Debate: how to identify a document If we use a string, then we'll have problems identifying the language; or, we extend the document name syntax to also support the language, like: wiki:Space.Document[lang] or wiki:Space.Document@lang. +: if we keep the same syntax for the new model, we'll be able to reuse the same API for both the old and new model. -: Usually this applies to the context document ($tdoc), which means that we'll have an extra clone, more memory, more cpu. If we use (only) XWikiDocument, we'll also need an API for it. +: easy to use from Java/groovy -: hard to use from Velocity -: migration to the new model If we use (only) Document, we'll be able to easily use this from velocity. +: easy to use from Velocity 0: a bit harder to use from Java -: migration to the new model. If we use all of these methods, then it will be easy to use the plugin both from Java and Velocity, but we'll have a large API. +: easy to use -: large API 0: migration to the new model, both easier because we simply add a new method, and harder because we must deprecate and support 2 signatures for each method. For the moment my preference goes to either using just a String, or to use all 3 methods. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Tue, Jan 20, 2009 at 6:50 PM, Sergiu Dumitriu <[email protected]> wrote:
Is this global? I mean, does it get all tags found in the wiki, or just the tags for the current document? I'd like to also have a method to get tags for a document (+ for translations), since the getTags method does not belong to the Document class (although it is part of the current API, I'd like to see it removed in the new model). Maybe we should deprecate it after we add this plugin/application.
It is global and was named getAllTags at first, ok to rename it.
What does "distinct" do? I'd rather have a caseSensitive parameter, or different methods for this.
Distinct was not about case but about tag occurences here which appears to be misleading.
public List<String> getPagesWithTag(String tag);
Pages? This is not our terminology.
I hesitated for this. We're kind of mixing both and I tend to use page everywhere since I vaguely remember we discussed in the past that in the future we should move from Document to Page like we did (and do) from Web to Space. Anyway I agree that it's not consistent with the other APIs, I'll rename.
public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag);
What happens when the user does not have the right to alter all the documents, only some of them? Will the changes appear in whatsnew? Will they create new versions? Will they change the author?
I check XWiki.hasAdminRights() in the API since I consider this as an administration task. Those renames create new minor versions thus not appearing in whats new.
We'd also need a method to get all tags with their occurrence count (for the tag cloud).
I did it with more logic on the velocity side (and with the 'distinct' above) but this would be better.
So, how about this API:
- List<String> getAllTags() -> all wiki tags, case insensitive (CI) - List<String> getAllTags(boolean caseInsensitive) -> all tags
At first I put a ignoreCase argument in getPagesWithTag, renameTag, deleteTag .. then I decided not to take care of the case since this is not something we usualy do in XWiki (document names for example) and thought that if we really need it we could still have a global option for this in the future.
- HashMap<String, Integer> getTagCount() -> all wiki tags with occurrence, CI - HashMap<String, Integer> getTagCount(boolean caseInsensitive) -> all wiki tags with occurrence - List<String> getTagsForDocument(Document doc) -> document tags --> Debate: XWikiDocument, Document or String? Or all?
I'd say juste a String ftm, aka fullName.
- boolean addTagToDocument(String tag, Document doc) -> returns true if the tag was successfully added, false if the tag was already associated. Throws exceptions in other cases (not enough rights, db issues, etc). - boolean removeTagFromDocument(String tag, Document doc) -> returns true if the tag was successfully removed, false if the tag was not associated. Throws exceptions in other cases (not enough rights, db issues, etc). - public List<String> getDocumentsWithTag(String tag) - public boolean renameTag(String tag, String newTag) - public boolean deleteTag(String tag)
Fine with this. Revised proposal: List<String> getAllTags() HashMap<String, Integer> getTagCount() List<String> getDocumentsWithTag(String tag) boolean renameTag(String tag, String newTag) boolean deleteTag(String tag) boolean addTagToDocument(String tag, String fullName) boolean removeTagFromDocument(String tag,String fullName) List<String> getTagsForDocument(String fullName)
Debate: how to identify a document [snip]
I'm snipping the debate since I think it is related to a more broader discussion about the new model. Thanks, JV.
+1 for the revised proposal. Jean-Vincent Drean wrote:
On Tue, Jan 20, 2009 at 6:50 PM, Sergiu Dumitriu <[email protected]> wrote:
Is this global? I mean, does it get all tags found in the wiki, or just the tags for the current document? I'd like to also have a method to get tags for a document (+ for translations), since the getTags method does not belong to the Document class (although it is part of the current API, I'd like to see it removed in the new model). Maybe we should deprecate it after we add this plugin/application.
It is global and was named getAllTags at first, ok to rename it.
What does "distinct" do? I'd rather have a caseSensitive parameter, or different methods for this.
Distinct was not about case but about tag occurences here which appears to be misleading.
public List<String> getPagesWithTag(String tag); Pages? This is not our terminology.
I hesitated for this. We're kind of mixing both and I tend to use page everywhere since I vaguely remember we discussed in the past that in the future we should move from Document to Page like we did (and do) from Web to Space. Anyway I agree that it's not consistent with the other APIs, I'll rename.
public boolean renameTag(String tag, String newTag); public boolean deleteTag(String tag); What happens when the user does not have the right to alter all the documents, only some of them? Will the changes appear in whatsnew? Will they create new versions? Will they change the author?
I check XWiki.hasAdminRights() in the API since I consider this as an administration task. Those renames create new minor versions thus not appearing in whats new.
We'd also need a method to get all tags with their occurrence count (for the tag cloud).
I did it with more logic on the velocity side (and with the 'distinct' above) but this would be better.
So, how about this API:
- List<String> getAllTags() -> all wiki tags, case insensitive (CI) - List<String> getAllTags(boolean caseInsensitive) -> all tags
At first I put a ignoreCase argument in getPagesWithTag, renameTag, deleteTag .. then I decided not to take care of the case since this is not something we usualy do in XWiki (document names for example) and thought that if we really need it we could still have a global option for this in the future.
- HashMap<String, Integer> getTagCount() -> all wiki tags with occurrence, CI - HashMap<String, Integer> getTagCount(boolean caseInsensitive) -> all wiki tags with occurrence - List<String> getTagsForDocument(Document doc) -> document tags --> Debate: XWikiDocument, Document or String? Or all?
I'd say juste a String ftm, aka fullName.
- boolean addTagToDocument(String tag, Document doc) -> returns true if the tag was successfully added, false if the tag was already associated. Throws exceptions in other cases (not enough rights, db issues, etc). - boolean removeTagFromDocument(String tag, Document doc) -> returns true if the tag was successfully removed, false if the tag was not associated. Throws exceptions in other cases (not enough rights, db issues, etc). - public List<String> getDocumentsWithTag(String tag) - public boolean renameTag(String tag, String newTag) - public boolean deleteTag(String tag)
Fine with this. Revised proposal:
List<String> getAllTags() HashMap<String, Integer> getTagCount() List<String> getDocumentsWithTag(String tag) boolean renameTag(String tag, String newTag) boolean deleteTag(String tag) boolean addTagToDocument(String tag, String fullName) boolean removeTagFromDocument(String tag,String fullName) List<String> getTagsForDocument(String fullName)
Debate: how to identify a document [snip]
I'm snipping the debate since I think it is related to a more broader discussion about the new model.
Thanks, JV. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (7)
-
Jean-Vincent Drean -
Jean-Vincent Drean -
Jerome Velociter -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol