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).
-
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 seeXWikiDocument#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 theDocumentAuthors
directly. -
As a bonus question, I’m honestly hesitating between
a.
setAuthorReference
andb.
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