On 02/04/2010 06:26 PM, Guillaume Lerouge wrote:
Hi,
On Thu, Feb 4, 2010 at 6:21 PM, Sergiu Dumitriu<[email protected]> wrote:
On 02/04/2010 06:02 PM, Guillaume Lerouge wrote:
Hi Daniel,
On Thu, Feb 4, 2010 at 5:45 PM, Daniel Johansson<[email protected] wrote:
Indeed, I just tried in 2.2M2 and it tells you the document exists. in
2.04
I did not delete the older post, it got overwritten so now I had 2 posts with the exact same title and content in the News category, it's still here in our wiki. And I actually updated the first post which updated both posts! They are identical, same date, title and content.
The solution to tell user that document already exist is not very good. In time you may have hundreds of blog entries in one category, making it pretty hard to keep titles unique. In our case we wanted to use it to post what testing is to be done for the week. So each week you want to post an entry such as "Weekly testing". It'll be hard to come up with unique variants to that every week!
You can modify the article creation form to add something like:
$xwiki.getUniquePageName($space, $input)
see
http://platform.xwiki.org/xwiki/bin/download/DevGuide/API/xwiki%2Dcore%2D2.1...
details.
Sergiu, I'm starting to think we could add this to most of the creation forms to avoid duplicates, WDYT?
I'm increasingly doing it for apps I write on my projects (almost all the time now).
I'm not quite fond of this idea, but something more complex would work. If the page already exists, offer a few options:
- link to the page so that the user can go to it and edit it instead of creating a new page - let the user type another page name - use getUniquePageName, which appends a number at the end - append the current date at the end
I'd go for this one, it's the most transparent for the user. Adding an extra step for the user sounds like an un-necesary step. Think about the "Weekly Article" use case -> an extra click each time (+ time spent pausing and thinking about the right option) would end up causing un-needed hassle each time.
This is just one usecase, and it's a wrong one. Creating something called "This week's tasks" is wrong because it's out of context. When you look at the blog and see 20 "This week's tasks" articles, which one do you choose? There should be contextual information from the title. Fortunately, in the blog there is contextual information from the date displayed next to the title. But you don't have that (at least not that easy to notice) in the document index, in the JumpToPage, in search results, etc. A more correct title would be "Tasks for week 42". And that's unique. And in that case, if I try to create an article called "Tasks for week 42" and the article is already there, I'd like to know instead of being redirected to "Tasks for week 43". Maybe someone already created the document, doing half my work. Maybe I typed the wrong name and it should be week 52 instead. Do you really think that one more click is worse than the wiki taking the (often wrong) decision for me? -- Sergiu Dumitriu http://purl.org/net/sergiu/