Wiki source code of XWiki custom development

Version 3.1 by Alex Cotiuga on 2026/05/18 19:23

Hide last authors
Alex Cotiuga 1.1 1 {{velocity}}
2 #set ($discard = $xwiki.ssx.use('PublicWebSite.WebHome'))
3 {{html clean="false"}}
4
5 <section class="resource-header" aria-labelledby="hero-title">
6 <div class="container">
7 <div class="text-center">
Alex Cotiuga 3.1 8 <div class="hero-kicker">
Alex Cotiuga 1.1 9 <i class="fa fa-code" aria-hidden="true"></i>
10 XWiki custom development guidance
11 </div>
12 </div>
13
Alex Cotiuga 2.1 14 <h1 id="hero-title">How to customize XWiki without creating upgrade problems</h1>
Alex Cotiuga 1.1 15
16 <p class="resource-summary">
Alex Cotiuga 2.1 17 XWiki can be adapted to complex business needs. The important part is to keep custom work documented,
18 versioned and easy to validate during future upgrades.
Alex Cotiuga 1.1 19 </p>
20 </div>
21 </section>
22
23 <section class="resource-page">
24 <div class="container">
25 <div class="resource-layout">
26
27 <article class="resource-content">
28
29 <p>
Alex Cotiuga 2.1 30 Many organizations choose XWiki because it can grow beyond a simple documentation space. A platform may start
31 with pages, attachments and permissions, then evolve into structured applications, approval workflows, custom
32 dashboards, branded PDF exports, integrations or internal tools built around the company’s real processes.
Alex Cotiuga 1.1 33 </p>
34
35 <p>
Alex Cotiuga 2.1 36 This flexibility is valuable, but it also raises a legitimate concern: will custom development make upgrades
37 harder? The answer depends less on the existence of custom code and more on the way it is organized. A controlled
38 customization can remain stable for years. An undocumented change applied directly in production can become a
39 maintenance problem after the next upgrade.
Alex Cotiuga 1.1 40 </p>
41
42 <div class="resource-note">
43 <p>
Alex Cotiuga 2.1 44 <strong>The main point:</strong> custom code is not the problem. Uncontrolled custom code is. XWiki can be
45 customized safely when changes are separated from standard pages, tracked, documented and tested.
Alex Cotiuga 1.1 46 </p>
47 </div>
48
Alex Cotiuga 2.1 49 <h2 id="why-customize">Why XWiki custom development exists</h2>
Alex Cotiuga 1.1 50
51 <p>
Alex Cotiuga 2.1 52 Avoiding all customization may look safer at first, but it can create other costs. Users may start maintaining
53 side spreadsheets, sending approvals by email, duplicating data in external tools or bypassing the wiki because
54 it does not match their daily work. In these cases, a well-designed XWiki customization can simplify the process
55 and improve adoption.
Alex Cotiuga 1.1 56 </p>
57
58 <p>
Alex Cotiuga 2.1 59 Typical examples include custom metadata for documents, templates for recurring content, dashboards for teams,
60 approval flows, notifications, PDF layouts, page actions, UI extensions, macros and integrations with systems
61 such as authentication providers, ticketing tools, storage services, CRM platforms or AI assistants. These
62 features can be implemented at different levels, from wiki pages and scripts to packaged Java extensions.
Alex Cotiuga 1.1 63 </p>
64
Alex Cotiuga 2.1 65 <h2 id="where-risk-appears">Where customization becomes risky</h2>
Alex Cotiuga 1.1 66
67 <p>
Alex Cotiuga 2.1 68 Problems usually appear when nobody can quickly explain where a customization is implemented, why it exists or
69 how it should be tested. Business logic mixed into regular content pages, standard pages changed without notes,
70 scripts that exist only in production, hardcoded group names or missing upgrade checks are common signs that the
71 customization process needs more structure.
Alex Cotiuga 1.1 72 </p>
73
74 <p>
Alex Cotiuga 2.1 75 This is especially important in XWiki because custom logic can live in several places: classes, objects, sheets,
76 templates, Velocity or Groovy scripts, panels, UI extensions, macros, scheduled jobs and Java components. The
77 flexibility is useful, but each important customization should have a clear location and a clear maintenance
78 path.
Alex Cotiuga 1.1 79 </p>
80
Alex Cotiuga 2.1 81 <h2 id="safe-model">A safer model for XWiki custom work</h2>
82
83 <h3>1. Keep custom code separate from standard XWiki pages</h3>
Alex Cotiuga 1.1 84 <p>
Alex Cotiuga 2.1 85 Custom classes, scripts, templates and configuration should usually live in dedicated technical spaces, for
86 example a company-specific <code>Code</code>, <code>Applications</code>, <code>Templates</code> or
87 <code>Config</code> area. This makes it easier to see what belongs to the standard distribution and what belongs
88 to the organization.
Alex Cotiuga 1.1 89 </p>
90
Alex Cotiuga 2.1 91 <h3>2. Document the purpose, not only the implementation</h3>
Alex Cotiuga 1.1 92 <p>
Alex Cotiuga 2.1 93 A short technical note is often enough: what the customization does, who uses it, where it is implemented, what
94 assumptions it makes and what should be checked after an upgrade. This turns custom work from a hidden script
95 into a maintainable part of the platform.
Alex Cotiuga 1.1 96 </p>
97
Alex Cotiuga 2.1 98 <h3>3. Track important changes in a version control system</h3>
Alex Cotiuga 1.1 99 <p>
Alex Cotiuga 2.1 100 Serious custom development should not exist only inside the production wiki. Java code, scripts, XAR packages,
101 deployment files and important templates should be stored in a version control system, such as Git. This gives
102 the team a history of what changed, when it changed and why.
Alex Cotiuga 1.1 103 </p>
104
Alex Cotiuga 2.1 105 <h3>4. Choose the right implementation level</h3>
Alex Cotiuga 1.1 106 <p>
Alex Cotiuga 2.1 107 Many useful features can start as wiki-based customizations using XWiki classes, sheets, templates, Velocity or
108 UI extensions. When a feature becomes complex, reusable or business-critical, packaging it as an extension is
109 often a better long-term option. Event listeners, custom services, scheduled jobs, integrations and advanced
110 workflow logic usually benefit from this approach.
Alex Cotiuga 1.1 111 </p>
112
Alex Cotiuga 2.1 113 <h3>5. Keep configuration outside the code</h3>
Alex Cotiuga 1.1 114 <p>
115 Group names, target spaces, template references, email recipients, external URLs and workflow settings should
Alex Cotiuga 2.1 116 not be hardcoded when they are likely to change. Configuration pages or preference objects make the feature
117 easier to adapt without rewriting the implementation.
Alex Cotiuga 1.1 118 </p>
119
Alex Cotiuga 2.1 120 <h2 id="upgrade-validation">Validate custom features during upgrades</h2>
121
Alex Cotiuga 1.1 122 <p>
Alex Cotiuga 2.1 123 A successful upgrade is not only one where XWiki starts and standard pages load. The upgrade plan should also
124 include the features that make the instance specific to the organization: custom dashboards, templates, macros,
125 workflows, permissions, notifications, PDF exports, scheduled jobs and integrations.
Alex Cotiuga 1.1 126 </p>
127
128 <p>
Alex Cotiuga 2.1 129 For each important customization, the team should know what to test and what a successful result looks like. A
130 staging environment or temporary clone is usually the safest place to run this validation before production is
131 touched.
Alex Cotiuga 1.1 132 </p>
133
Alex Cotiuga 2.1 134 <div class="resource-note">
135 <p>
136 <strong>A practical rule:</strong> production can receive urgent fixes when necessary, but it should not become
137 the only place where the real version of a customization exists. After the emergency, the change should be
138 reviewed, documented and added to the normal maintenance process.
139 </p>
140 </div>
Alex Cotiuga 1.1 141
Alex Cotiuga 2.1 142 <h2 id="practical-checklist">A compact checklist</h2>
Alex Cotiuga 1.1 143
Alex Cotiuga 2.1 144 <ul class="resource-checklist">
145 <li>Separate custom pages, scripts and configuration from standard XWiki content.</li>
146 <li>Document the business purpose, technical location and validation steps.</li>
147 <li>Use a version control system, such as Git, for code and important assets.</li>
148 <li>Test custom features on staging before production upgrades.</li>
149 <li>Review old customizations and remove what is no longer used.</li>
Alex Cotiuga 1.1 150 </ul>
151
152 <h2 id="strategic-advantage">Custom code can become a strategic advantage</h2>
153
154 <p>
Alex Cotiuga 2.1 155 Many useful platform features start as custom development for one concrete need. A workflow, dashboard,
156 integration or structured application may first solve a private business problem, then become a reusable
157 internal component or even a public extension. This is how practical solutions often mature.
Alex Cotiuga 1.1 158 </p>
159
160 <p>
Alex Cotiuga 2.1 161 The goal is not to customize everything. The goal is to customize the right parts, in a way that can be
162 understood and maintained later. When custom work is separated, documented, versioned and tested, XWiki can stay
163 flexible without becoming fragile.
Alex Cotiuga 1.1 164 </p>
165
166 <div class="resource-cta">
167 <h3>Need help reviewing XWiki customizations?</h3>
168 <p>
169 If your XWiki instance includes custom scripts, dashboards, workflows, templates, integrations or Java
Alex Cotiuga 2.1 170 extensions, a customization review can help identify what is safe, what needs documentation and what should be
171 tested before the next upgrade.
Alex Cotiuga 1.1 172 </p>
173 <a class="btn btn-primary" href="$xwiki.getURL('contact.WebHome')">Request a customization review</a>
174 </div>
175
176 </article>
177
178 <aside class="resource-sidebar" aria-label="Page summary">
179 <h4>In this guide</h4>
180 <ul>
181 <li><a href="#why-customize">Why customize XWiki</a></li>
Alex Cotiuga 2.1 182 <li><a href="#where-risk-appears">Where risk appears</a></li>
Alex Cotiuga 1.1 183 <li><a href="#safe-model">Safe model</a></li>
Alex Cotiuga 2.1 184 <li><a href="#upgrade-validation">Upgrade validation</a></li>
185 <li><a href="#practical-checklist">Checklist</a></li>
Alex Cotiuga 1.1 186 <li><a href="#strategic-advantage">Strategic advantage</a></li>
187 </ul>
188 </aside>
189
190 </div>
191 </div>
192 </section>
Alex Cotiuga 2.1 193
Alex Cotiuga 1.1 194 {{/html}}
195 {{/velocity}}