Hi!
I am developing my API extension. It's enumerating revisions, but in a
different way (not like in ApiQueryRevisions class). Also, it can
optionally create xml dumps via WikiExporter, like API
action=query&export&exportnowrap (so I need to change output printer to
raw mode sometimes). Because it's enumerating the lists (however not
titles) I've choosed "list in non-generator mode" (derived from
ApiQueryBase). However, after initial development I've figured out that
I cannot change default printer in such case, because it's not being
called at all. The reason is explained in following message by Roan
Kattouw:
https://bugzilla.wikimedia.org/show_bug.cgi?id=25232
Query submodules can be called in conjunction with
other query
submodules
In this case, if your module would switch to a custom
printer, the
others would quite likely freak out.
But, I don't need to query in conjunction. Ok, I've derived from ApiBase
class (my own API action). Then, it starts to fail on huge amount of
generally useful methods, like SQL query building methods (addJoinConds,
addWhereRange) and list continuation methods (setContinueEnumParameter),
because these are not defined in ApiBase.
I understand that not every ApiBase derived class needs these, but many
could have. Why not make inheritance chain like this:
ApiBase -> ApiListBase -> ApiQueryBase
where ApiListBase would have at least these nice SQL query buliding
methods but also the possibility to override the default printer? Why
these methods are limited to action=query lists and generators only?
Dmitriy