Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1338

Introduce an author setter helper in XWikiDocument for the most common use case

$
0
0

Hi devs,

After some time of using the new DocumentAuthors API and while we are happy with the feature it brings (separating of right and display authors) it added quite some complexity for most common use cases for developers of extensions who are manipulating the XWikiDocument API (the handling of authors in the script Document API is mostly automated so that one is fine IMO).

  1. I propose that we kind of get back a bit from the “let’s move everything to a dedicated DocumentAuthors API only to be clean” but this time to see XWikiDocument#setAuthorReference(UserReference) as a more discoverable unique helper for the most common use case (setting both the display and right authors to the same thing and let the store update the content author depending on the content dirty flag) and if you have a more advanced need you can manipulate the DocumentAuthors directly.

  2. As a bonus question, I’m honestly hesitating between a. setAuthorReference and b. setAuthor as the later might feel more natural for someone searching to set the author of the document.

WDYT ?

Here is my +1 for 1..

I’m fine with both variations in 2. with a slight preference for setAuthor. I would have definitely chosen setAuthorReference if there was a corresponding getter, but it’s really not the point here, and I would be -1 for such a getter right now as it would not make much sense.

10 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 1338

Trending Articles