Documentation Stats App
Description
- Goals
- Definitions
- Specific to xwiki.org: the migration
- The summary
- Page by page, per audience
- Extension pages, page by page
- Pages on rendering.xwiki.org
- FAQ pages
- New documentation pages per month
- Contributors per month
- Where the migration progress number comes from
- A denominator for the extensions
- Query rules the numbers depend on
- Marking what was converted before all this existed
- The mapping object
- Generic features for the stats app
- Not built yet
This app goes together with the Documentation App, as part of the new Documentation strategy migration. Pages are being moved, bit by bit, from extensions.xwiki.org/Extension, Documentation/UserGuide, Documentation/AdminGuide, Documentation/DevGuide, rendering.xwiki.org and the FAQ space into one place: xwiki.org/xwiki/bin/view/documentation/.
The doc stats app shows how that move is going: who contributes, which pages get the most edits, and how much of the new space is filled in already.
The features below are split in two, because they do not have the same lifetime. The migration features answer "how far along are we?" and stop being meaningful once the migration is over. The generic features answer "what state is the documentation in, and who is looking after it?", which stays true afterwards.
The migration half is no longer only a design: it runs today as a set of plain wiki pages on xwiki.org, under XWikiOrg.documentation-scripts-queries.migration-progress. What is written below describes those pages, so that the design and what is live say the same thing; the parts that are still only a proposal are gathered in Not built yet at the end.
Goals
- Show who is most active (creating and editing pages) in new location: /documentation
- Show which pages get edited the most
- Show how many new pages were made in /documentation this week, this month, this year, and in total
- Show how much of the migration is actually done, not only how many pages exist
Definitions
Every number on the dashboard depends on these rules, so they are stated here.
- Documentation page: a page under documentation. carrying a DocumentationClass xobject. Technical pages (WebPreferences, sheets, class pages) have no such object and are therefore never counted.
- New page: a move/rename should not count as new page under ../documentation/..
- Edit: one revision of such a page. Major and minor edits are counted separately and displayed side by side with a total, behind a "Show minor edits" toggle that works like the one in the history tab. A minor save is the one that only increments the second digit of the version (1.1 -> 1.2).
- Contributor: the author of the revision, except for pages published through a Change Request (see below).
- Not counted: imports and migration scripts (superadmin, bot accounts), XWikiGuest, and translations - only the original document counts.
- Page, not document: the index holds one document per translation, so a set that has translations counts high if the documents are counted instead of the pages. doclocale:"" keeps the original only - on rendering.xwiki.org that is the difference between 119 documents and 66 pages.
- Done, for a legacy page on the main wiki: it carries the done tag. In progress: it carries a mapping object listing its replacements, but neither tag yet. Unconvertable: it carries the unconvertable tag - its content documents something deprecated, so it has no place in the new documentation and will be neither converted nor mapped. Those three are deliberately separate, so that "replacements exist, the move is not finished" and "there is nothing to move" are both expressible. Either tag takes the page out of Left, which is the work still ahead.
- Done, for an extension page: its website field is filled. Nothing else is needed there.
Specific to xwiki.org: the migration
These features exist for as long as the migration does. They are the only part of the app that knows about the legacy trees, so they are kept apart from the rest - own space, (possible own scheduled job) - and can be removed at the end without touching anything else.
They currently live under XWikiOrg.documentation-scripts-queries.migration-progress, as seven pages:
| Page | What it shows |
|---|---|
| migration-progress | the summary: one table per legacy wiki or set - the three trees of the main wiki, the extension pages, rendering.xwiki.org, the FAQs |
| migration-progress.main-wiki-details | one row per legacy page of a tree, with what it was converted into. ?audience=user / admin / dev |
| migration-progress.extensions-details | one row per extension page. ?scope=noid / withid / project |
| migration-progress.rendering-details | one row per page of rendering.xwiki.org. ?scope=all / main |
| migration-progress.faq-details | one row per FAQ entry |
| migration-progress.new-pages | one row per month: how many pages of the new documentation were created in it |
| migration-progress.contributors | who created and who edited those pages, one table per month. ?month=2026-10 |
Every number is computed when a page is displayed, by querying the search index; nothing is stored, and there is no scheduled job. Running those queries from a wiki page needs script right, declared with an XWiki.RequiredRightClass object on the page.
The summary
One table per wiki or set.
For the legacy trees of the main wiki, a row per tree (Documentation.UserGuide, Documentation.AdminGuide, Documentation.DevGuide) and a total row, with the columns:
- Pages - the pages of the tree: not hidden, WebPreferences excluded.
- Done - of those, the ones tagged done.
- Unconvertable - the ones tagged unconvertable: deprecated content, nothing to convert.
- In progress - the ones holding a mapping object but carrying neither tag, that is, started and not finished.
- Left - the ones carrying neither tag.
- Page by page - a link to the detail page for that tree.
Left is queried rather than obtained by subtracting Done and Unconvertable from Pages: nothing stops a page from carrying both tags, and subtracting the two counts would then take it out of the column twice.
Under the table, one stacked bar per tree and one for the three together: a first segment for what is resolved, a second for what is started but not finished, and the track showing through for the work still ahead. Resolved is Pages minus Left, not Done plus Unconvertable, for the same reason Left itself is queried - a page carrying both tags would be counted twice and the bar would overfill. The bars use the skin's own progress-bar classes, so they follow the color theme rather than carrying colours of their own, and they read the counts the table already computed rather than querying again.
For the extension pages, a row per scope - all pages, pages without an id, pages with an id, project or pom pages - with the number of pages, how many of them are done, and a link to the matching scope of the extension detail page.
The last of those rows counts a different population, and one the three others miss entirely:
- a project page carries an ExtensionCode.ProjectClass object and no ExtensionClass one - it groups the modules of a single project under one page, so it is not an extension page and none of the other rows sees it; its own done signal is the ProjectClass website field, not the ExtensionClass one;
- a pom page carries an ExtensionCode.ExtensionProxyClass object: its metadata is imported from a Maven repository rather than typed on the wiki, so its website comes from the pom.
The two sets overlap, so the row counts their union and not their sum.
The extension table gets the same bars, with no second segment: an extension page is done when its website field is filled, and there is no half-finished state to show. The rendering and FAQ tables get none, since neither set has a done count yet.
For rendering.xwiki.org, a row for the whole wiki and a row for its Main space. For the FAQs, one row: the pages of the FAQ space carrying a FAQCode.FAQClass object. Neither table has a Done column yet, because no page of either set carries a tag or a mapping object so far.
Page by page, per audience
The summary answers "how many"; this page answers "which ones", and it is the same queries listed instead of counted. One page serves the three trees, selected by ?audience=user, admin or dev, with a switcher at the top and the User guide as the default. The parameter was named tree until 2026-10-02 and is still read as a fallback, so an old bookmark opens the guide it named instead of silently falling through to the default one.
Columns:
- Legacy page - its title, linked.
- Done - whether it carries the done tag.
- Unconvertable - whether it carries the unconvertable tag.
- Converted into - the replacements recorded in its mapping object, plus its redirect target when the object does not already name it, marked as such.
- Redirects to - the location of its XWiki.RedirectClass object, when it has one.
- Still has backlinks - how many pages still link to this one, linking to the page's own Information tab. A page that already redirects is not queried and shows a dash: a redirect sends every one of those readers on.
The footer totals the pages, the done ones, the unconvertable ones, the distinct replacement pages of the whole tree, the redirects and the pages still linked to. Distinct matters: several legacy pages often converge on the same new page, so that total is smaller than the sum of the rows, and a sum would overstate how much new documentation exists.
The redirect column is a third signal, independent of both the tag and the object: a page that already sends its readers elsewhere was converted, whether or not anybody marked it. That is why it is displayed rather than merely counted - it is the input for the backfill below.
The backlink column answers a different question, and one that only appears at the end: what has to be repointed before a legacy page can be deleted. It is read from the same index the Information tab reads, so the two always agree, and it includes the backlinks coming from the other wikis of the farm - a large share of them. What the index cannot see is a link written as an absolute URL ([[...>>url:https://www.xwiki.org/...]]); those need a separate search of the page content.
Extension pages, page by page
Three scopes, because they have nothing to say to each other:
- ?scope=noid (the default) - the extension pages carrying an empty id. Columns: page, website; the footer counts the pages and how many have a website. They are the gap between "number of pages" and "number of extensions", and most of them are not something anybody has to document.
- ?scope=withid - the ones with an id, grouped by id prefix: org.xwiki.platform, org.xwiki.contrib, org.xwiki.rendering, org.xwiki.commons, then everything else. Columns: page, id, website. The grouping is what makes the scope question below answerable by looking.
- ?scope=project - the project and pom pages, grouped by the same prefixes. Columns: extension, id, project page, pom page; the footer counts each kind and how many pages are both. The id read here is the ProjectClass one when there is one and the ExtensionClass one otherwise, which is why these rows are sorted in Velocity rather than by Solr: no single sort can express "either of two fields".
Pages on rendering.xwiki.org
rendering.xwiki.org is a wiki of the same farm, so the same index answers for it with wiki:rendering. Two scopes:
- ?scope=all (the default) - every page of the wiki, grouped by top-level space. Half of the wiki is the flavor it was installed with (Help, Sandbox, ColorThemes, Panels, XWiki) rather than rendering documentation, and only the grouping shows which half is which. Columns: page, reference.
- ?scope=main - the Main space, which is the half holding the documentation, with the same columns and the same done/converted/redirect tests as the legacy trees of the main wiki.
FAQ pages
A FAQ is a page of the FAQ space carrying a FAQCode.FAQClass object - the set its home page lists. Pages of that space without the object are deliberately out of scope. The detail page has no scope switcher: one table, the same columns and the same tests as the legacy trees.
New documentation pages per month
The other side of the same story: the tables above count the legacy trees shrinking, this one counts the new tree growing. One row per month from January 2026 on, each a stacked bar split between documentation.xs and documentation.extensions, scaled to the busiest month shown.
This is what progress over time means here: how many new pages are published each month. It needs no snapshot - a page's creation date is in the index, so the series is derived at display time and the first month is as available as the last. What counts as a page is what counts everywhere else here: under documentation., carrying a DocumentationClass object, landing pages and translations excluded.
Pages created before January 2026 are not shown as rows but are counted in the running total, which therefore stays a count of every page in the tree rather than of those written since the series starts. The baseline is stated above the first row, so that the first month does not look as though it produced it.
A page moved into the new documentation keeps its original creation date, so it counts in the month it was first written rather than the month it arrived, and the index cannot tell the two apart. The months read as when the page came into existence, not as when the documentation grew.
An older page, XWikiOrg.documentation-scripts-queries.NewDocumentationProgress, counts the same thing with a hand-maintained table feeding a {{chart}} macro, and lists the pages of a month with their creator on demand. The two agree for every month of 2026 and differ for 2025 - its query filters on the class alone, so it also counts hidden pages and translations. Which definition wins is worth settling, since the two are a duplicate with different failure modes: the hardcoded table drifts, the computed one cannot.
Contributors per month
Who created and who edited the documentation pages of a month, ranked, one table per month with a month switcher. Two columns that do not overlap: a page someone created that month is counted under Created only, so Edited is what they worked on without having started it. A page counts once per person per month however many times they saved it, so twenty saves of one page do not outrank twenty pages.
The population is the one the rest of the dashboard uses - a page carrying a DocumentationClass object, not hidden, original locale only - so the Created column reconciles month by month with the series above.
This is the one page the search index cannot answer. The index holds a page's creator and its last author, which says nothing about who edited it in a given month, so the counts come from the revision metadata (XWikiRCSNodeInfo) joined to the documents and their class objects. That means HQL, which means programming right rather than the script right the other pages declare - the thing that does not travel into a packaged extension for free.
Two rules the numbers depend on:
- Fold the author strings before ranking. Some revisions store the author with a wiki prefix (xwiki:XWiki.X) and some without, so the same person otherwise appears twice.
- Leave XWiki.superadmin and XWiki.XWikiGuest out. Those are the imports and the migration scripts. In 2026 superadmin created no documentation page, which is why the Created totals match the month's page count exactly.
What the ranking cannot fix on its own: one person can hold several accounts - a testing account of the same name ranks third in October 2026 with 82 edited pages - so a reusable version needs an alias map or an exclusion list rather than trusting the author field.
Where the migration progress number comes from
The denominator is a listing of the legacy trees. The numerator - which of those pages are done - differs per wiki:
- extensions.xwiki.org: no new xobject to add. The website field is already filled when a page has been converted, and points at the extension's generated documentation listing (/bin/view/DocApp/Code/ExtensionLD?id=...), so a filled field is the done marker. On a project page the field read is the ProjectClass one.
- www Documentation.UserGuide / AdminGuide / DevGuide, and the same for rendering.xwiki.org and the FAQs: there is no field to reuse, so these pages get the done tag once their content has been entirely moved. One query: property.XWiki.TagClass.tags:done. Tags are a plain object property, so there is nothing else to index. The unconvertable tag is counted the same way and says the opposite thing: this page is leaving the tree without ever being converted.
The marker goes on the legacy page, not on the new one: what has to be counted is the legacy pages that do not have a replacement yet, and only the legacy page can carry that.
A tag was chosen over a field in the mapping object because it can be set from the page itself, without opening the object editor. The cost is that it is reader-facing - it shows in the page's tag widget and in the tag listing, next to real topic tags - and that it is free text, so a misspelling silently does not count. What does not cost anything: the index matches the whole tag value rather than the words in it, so a common word is a safe choice, and matching is case-insensitive.
A denominator for the extensions
Pages are not extensions. A page can carry an empty id, and the same id can be carried by several pages, so a ratio computed over pages is not a ratio over things to document. The set that can honestly be a denominator is the distinct ids, obtained by faceting the index on the id field.
Which of those ids are in scope is still open, and it is a decision, not a measurement problem: a large part of the extension pages are contrib extensions that the migration never planned to cover, while part of what has already been converted is contrib. One more filter is available when the target set is decided: /rest/repository/extensions lists only the ids that have a published version, which drops the user-prefixed sandbox pages.
Query rules the numbers depend on
These are not implementation details: get one of them wrong and the dashboard quietly shows a different number, with no error.
- Scope by wiki:. The index covers the whole farm, so an unscoped query also counts other wikis that have pages under the same space paths.
- Exclude hidden pages with hidden:false, and WebPreferences by name. They are technical pages, not documentation, and there are over a hundred of them across the three trees. A query run through /rest/wikis/query excludes hidden pages for you, which makes the two disagree if only one of them says so.
- Count pages, not documents, with doclocale:"". The index holds one document per translation, so a wiki whose pages are translated counts high: wiki:rendering answers 119 for 66 pages, Main.WebHome alone being translated 19 times. The three trees and the extension pages have no translations, which is why the difference only shows on the rendering wiki and the FAQs.
- Match the extension id on property.ExtensionCode.ExtensionClass.id_string, not on the unsuffixed name, which is the analysed text field and matches an id that merely contains the prefix. The string field is also the only one that can be faceted, which is how distinct ids are counted.
- Test a field for "filled" with :?* - one character, then anything. :*, :[* TO *] and a negated empty string all match pages whose value is the empty string, so they answer "every page is done".
- A TextArea property has no _string twin. It is indexed under the document's locale suffix instead, so it has to be matched, or asked for, by prefix - website_* in fl, found back by prefix in the row loop, since the sort twin website_sortString is never stored.
- Never bind an fl that drops wiki, spaces, name, type and doclocale. Results are resolved to a document reference to check view rights, and a result that cannot be resolved is dropped: the table empties while the total still looks right. Binding fl is otherwise worth it: asking only for the fields the table reads, rather than for every stored field of every page, took the extension listing from a little over two seconds to about one. class, the multi-valued field holding every class the page has an object of, has to be asked for like any other field a table reads.
- Sort on a sort field. title_sort for titles, fullname for references; the analysed fields cannot be sorted on. Solr sorts before the rights filter removes rows, so the order survives filtering and the groupings keep it.
- A tag query and its listing must use the same statement. Each detail page runs its done (and unconvertable) query as the same base statement plus the tag filter, so the summary and the listing can never disagree about what counts.
Marking what was converted before all this existed
Pages converted before the marker existed carry nothing, so they count as "not done" and the progress number comes out too low. They have to be marked once, after the fact:
- The pages that already redirect are the easy half: a redirect names its replacement, which is why the detail page lists it.
- The pages that were stripped down can be marked by a script: stripping leaves each heading followed by a "moved to" line, so the links in the content are exactly the list of replacements, and such a page is complete by definition.
- The rest have to be marked by hand, because nothing in them says where their content went.
After that there is no backlog to catch up: the mapping gets filled in while a page is being converted.
The mapping object
When a page is replaced by one or more others, the old page records what replaced it. The mapping is not part of this app. It is a plain XClass created on xwiki.org, which the stats app only reads - so it stays when the migration features are removed, and it is also what renders the "moved to" list for readers.
- XWikiOrg.documentation-scripts-queries.MigratedPageClass - a single field newPages, a TextArea holding the pages that replace this one, one per line.
- XWikiOrg.documentation-scripts-queries.MigratedPageSheet - a Velocity sheet bound to the class by an XWiki.ClassSheetBinding object on the class page. It reads the field, resolves each reference and renders them as a "this content has moved to ..." box above the page's remaining content.
The field holds one wiki link per line, not a bare reference, and its content type is fully rendered text rather than plain text. That is the opposite of what this page said at first, and the reason is the rename job: it rewrites links, and only links. A bare reference is invisible to it, so every entry went stale the moment its replacement page was moved - silently, since nothing checks a reference that is not a link. Readers of the field unwrap both forms, because the values written before the change are still bare.
Cross-wiki references have to carry the wiki prefix, since a legacy page on extensions.xwiki.org points at replacements on www. The rendering detail page has the mirror of that problem on the redirect column: a location may or may not name a wiki, so prefixing it unconditionally builds a reference that resolves to nothing and renders as a red link to a page that does exist.
The object says where the content went, not whether the move is finished - it can be filled in while the conversion is still going, and grow as more replacements appear. What says the page is done is the done tag, which is what the progress number counts.
Generic features for the stats app
These describe the documentation itself rather than the move, so they stay useful after the migration and are not specific to xwiki.org.
They need less configuration than this page first assumed: a documentation page is a page carrying a DocumentationClass object wherever it lives, so dropping the space filter is enough to make a query generic - on xwiki.org it returns the same set either way. Only the DocApp space has to be excluded, as the analysis itself excludes it.
Of these, only the contributor ranking is built, and as an xwiki.org page rather than as part of the app.
Contributors
- Most active contributors: list of users ranked by how many pages they created or edited in /documentation, for a chosen time period.
- Pages published through a Change Request used to be credited to the user who published them rather than to their author. CRAPP-437 fixed that in Change Request 1.24, so pages published after xwiki.org picked up that version carry their real author. Pages published before it still carry the publisher, which is worth knowing before trusting any contributor count, because people whose pages went through review get fewer credits than they should. Which version xwiki.org runs has to be checked before this feature is built.
Pages
- Most edited pages: pages in /documentation ranked by number of edits, for a chosen time period.
- New pages count: total pages created in /documentation, plus a breakdown by week/month/year.
- Current activity: per week/month/year/all time.
Other panels
- Pie charts per target audience, one chart per audience.
- For xs (XWiki Standard): number of pages for that audience, broken down by content type (e.g. 30% how-tos, 10% tutorials, 20% references, 40% explanations).
- For non-bundled extensions (each extension is a top-level page): one set of charts per extension:
- a chart showing the split by target audience (e.g. 50% user-facing pages, remainder split among other audiences)
- for each audience slice, a separate chart breaking that slice down by content type (e.g. within "user" pages: 30% how-tos, ...)
- Table with orphan pages: documentation pages with no incoming link.
Not built yet
What is described above and does not exist today:
- Legacy pages already stripped down, as a number of its own - the cleanup half of the migration. Only done, unconvertable and in progress are counted.
- Distinct extension ids as the denominator. The summary counts pages; the faceted distinct-id count exists as a query but is not a column yet, and it only becomes the right denominator once the target set is settled.
- A done column for rendering.xwiki.org and the FAQs. Neither set has been marked yet, so both tables count pages only; the tests are already in their detail pages and the column is a listing away.
- The remaining generic features - most edited pages, the pie charts, the orphans. Contributors now exist as an xwiki.org page (above), but not in a form that can be packaged: it needs programming right and an alias map.
- Packaging. These are wiki pages on xwiki.org, which is why they could be written without a tracker issue or a review. If they are ever packaged, the home is the documentation-xwikiorg pair in the xwiki-contrib/documentation repository, next to the generic documentation-api / documentation-ui - not a new project.
- Configuration instead of hardcoding, for the generic half to run on another wiki.