Version 18.8 by Alex Cotiuga on 2026/07/09 19:58

Show last authors
1 {{velocity wiki="false"}}
2 #if ($xcontext.action == 'get')
3 #set ($statusCode = 400)
4 #set ($message = 'The request could not be sent. Please try again or contact Agnease by email at alex@agnease.com.')
5
6 #set ($className = 'Agnease.Code.ContactRequest.ContactRequestClass')
7 #set ($allowedProperties = [
8 'scope',
9 'alreadyUseXWiki',
10 'name',
11 'email',
12 'hosting',
13 'customDevelopment',
14 'timeline',
15 'users',
16 'sourcePage'
17 ])
18
19 #set ($name = '')
20 #set ($email = '')
21 #set ($scope = '')
22 #set ($contactWebsite = '')
23 #set ($startedAtRaw = '')
24
25 ## Extract only the values we need for validation.
26 #foreach ($parameterName in $request.parameterNames)
27 #set ($propertyParts = $parameterName.split('_0_'))
28 #if ($propertyParts.size() > 1)
29 #set ($propertyName = $propertyParts[1])
30 #set ($propertyValue = $stringtool.trim($request.get($parameterName)))
31
32 #if ($propertyName == 'name')
33 #set ($name = $propertyValue)
34 #elseif ($propertyName == 'email')
35 #set ($email = $propertyValue)
36 #elseif ($propertyName == 'scope')
37 #set ($scope = $propertyValue)
38 #elseif ($propertyName == 'contactWebsite')
39 #set ($contactWebsite = $propertyValue)
40 #elseif ($propertyName == 'contactStartedAt')
41 #set ($startedAtRaw = $propertyValue)
42 #end
43 #end
44 #end
45
46 #set ($spamScore = 0)
47
48 ## Honeypot: real users should never fill this field.
49 #if ("$!contactWebsite" != '')
50 #set ($spamScore = $spamScore + 5)
51 #end
52
53 ## Submission timing check.
54 #if ("$!startedAtRaw" == '')
55 ## The field is expected from the real form, so missing it is suspicious.
56 #set ($spamScore = $spamScore + 2)
57 #else
58 #set ($startedAt = $numbertool.toNumber($startedAtRaw))
59 #if ("$!startedAt" == '')
60 #set ($spamScore = $spamScore + 2)
61 #else
62 #set ($now = $datetool.systemDate.time)
63 #set ($elapsed = $now - $startedAt)
64
65 ## Reject very fast submissions.
66 #if ($elapsed > 0 && $elapsed < 10000)
67 #set ($spamScore = $spamScore + 3)
68 #end
69 #end
70 #end
71
72 ## Random-looking name: long single token.
73 #if ($name.length() >= 16 && !$name.contains(' '))
74 #set ($spamScore = $spamScore + 2)
75 #end
76
77 ## Random-looking project description: long single token.
78 #if ($scope.length() >= 12 && !$scope.contains(' '))
79 #set ($spamScore = $spamScore + 2)
80 #end
81
82 ## Suspicious email local part with many dots and tiny fragments.
83 #set ($emailParts = $email.split('@'))
84 #if ($emailParts.size() == 2)
85 #set ($localPart = $emailParts[0])
86 #set ($localFragments = $localPart.split('\.'))
87 #set ($dotCount = $localFragments.size() - 1)
88 #set ($oneCharFragments = 0)
89
90 #foreach ($fragment in $localFragments)
91 #if ($fragment.length() == 1)
92 #set ($oneCharFragments = $oneCharFragments + 1)
93 #end
94 #end
95
96 #if ($dotCount >= 4 && $oneCharFragments >= 3)
97 #set ($spamScore = $spamScore + 2)
98 #end
99 #else
100 #set ($spamScore = $spamScore + 2)
101 #end
102
103 ## Human-facing validation.
104 #if ("$!name" == '' && "$!email" == '')
105 #set ($message = 'Please enter your name and email.')
106 #elseif ("$!name" == '')
107 #set ($message = 'Please enter your name.')
108 #elseif ("$!email" == '')
109 #set ($message = 'Please enter your email address.')
110 #elseif ("$!scope" == '' || $scope.length() < 30)
111 #set ($message = 'Please add a short description of your XWiki project, question or issue.')
112 #elseif ($spamScore >= 3)
113 #set ($message = 'The request could not be sent. Please add a clearer description of your XWiki request or contact Agnease by email.')
114 #else
115 #try('contactException')
116 #set ($now = $datetool.get('yyyyMMddHHmm'))
117 #set ($random = $mathtool.random(100000, 999999))
118 #set ($uniqueName = "ContactRequest-${now}-${random}")
119 #set ($contactRequestDoc = $xwiki.getDocumentAsAuthor('ContactRequests.' + $uniqueName))
120 #set ($contactRequestObj = $contactRequestDoc.getObject($className, true))
121
122 ## Save only known ContactRequest fields.
123 #foreach ($parameterName in $request.parameterNames)
124 #set ($propertyParts = $parameterName.split('_0_'))
125 #if ($propertyParts.size() > 1)
126 #set ($propertyName = $propertyParts[1])
127
128 #if ($allowedProperties.contains($propertyName))
129 #set ($discard = $contactRequestObj.set($propertyName, $request.get($parameterName)))
130 #end
131 #end
132 #end
133
134 #set ($discard = $contactRequestDoc.saveAsAuthor())
135 #set ($statusCode = 200)
136 #set ($message = 'Your request was successfully sent.')
137 #end
138
139 #if ("$!contactException" != '')
140 #set ($statusCode = 400)
141 #set ($message = 'The request could not be sent. Please try again or contact Agnease by email.')
142 #end
143 #end
144
145 #set ($discard = $response.setStatus($statusCode))
146 #jsonResponse({'message': $message})
147 #end
148 {{/velocity}}
149
150 {{velocity}}
151 #set ($discard = $xwiki.ssx.use('contact.WebHome'))
152 #set ($xobject = $doc.getObject('Agnease.Code.ContactRequest.ContactRequestClass'))
153 #set ($totalRequests = $services.query.xwql('from doc.object(Agnease.Code.ContactRequest.ContactRequestClass) contact').execute())
154 #set ($xclass = $xobject.xWikiClass)
155 #set ($editing = true)
156 = Tell Us More About Your Project =
157 You do not need to have a full specification. A short description is enough to start the conversation.
158 {{html clean="false"}}
159 You can also <a href="https://calendly.com/alex-agnease/30min?back=1&month=2026-06" target="_blank">book a free XWiki review call</a> to discuss your current setup.
160 <div class="row">
161 <div class="xform col-md-7">
162 #if ($totalRequests.size() > 50)
163 ## As a measure to avoid high load on website.
164 Tell us more about your project at <a href="mailto:alex@agnease.com">alex@agnease.com</a>
165 #else
166 #set ($hiddenProperties = ['sourcePage'])
167 <form id="contactForm">
168 <dl>
169 #foreach ($property in $xclass.properties)
170 #set ($hiddenPropertiesCSS = '')
171 #if ($hiddenProperties.contains($property.name))
172 #set ($hiddenPropertiesCSS = 'class="hidden"')
173 #end
174 #if ($property.name == 'hosting')
175 <hr>
176 <h3>Optional project details</h3>
177 <p>These details help us understand the scope and suggest practical next steps.</p>
178 #end
179 <dt $hiddenPropertiesCSS #if (!$editing && $hasEdit)
180 class="editableProperty"
181 #set ($xobjectPropertyReference = $xobject.getPropertyReference($property.name))
182 data-property="$escapetool.xml($services.model.serialize($xobjectPropertyReference))"
183 data-property-type="object"#end>
184 ## This must match the id generated by the $doc.display() method below.
185 #set ($propertyId = "${xclass.name}_${xobject.number}_$property.name")
186 <label#if ($editing) for="$escapetool.xml($propertyId)"#end>
187 $escapetool.xml($property.translatedPrettyName)
188 </label>
189 ## Support for specifying a translation key as hint in the property definition.
190 <span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
191 </dt>
192 <dd>$doc.display($property.name, 'edit').replace('{{html clean="false" wiki="false"}}', '').replace("{{/html}}", '')</dd>
193 #end
194 #if (!$xclass.properties || $xclass.properties.size() == 0)
195 ## Keep the empty definition term in order to have valid HTML.
196 <dt></dt>
197 <dd $hiddenPropertiesCSS>$escapetool.xml($services.localization.render('xclass.defaultObjectSheet.noProperties'))</dd>
198 #end
199 </dl>
200 <p class="xHint">* Your information will only be used to respond to this request.</p>
201 ## Hidden fields to catch requests filled by bots.
202 <div class="contact-hp-wrapper" aria-hidden="true">
203 <label for="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite">Website</label>
204 <input
205 id="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite"
206 type="text"
207 name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite"
208 autocomplete="off"
209 tabindex="-1"
210 />
211 </div>
212 <input type="hidden" name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactStartedAt" value="$datetool.systemDate.time" />
213 <input id="contactSubmit" type="submit" class="btn btn-primary" value="Send my request">
214 </form>
215 #end
216 {{/html}}
217 {{html clean="false" wiki="true"}}
218 <div class="reviewNotifications">
219 <div class="hidden reviewNotificationSuccess">
220
221 {{success}}reviewNotification{{/success}}
222
223 </div>
224 <div class="hidden reviewNotificationError">
225
226 {{error}}reviewNotification{{/error}}
227
228 </div>
229 </div>
230 {{/html}}
231 {{html clean="false"}}
232 </div>
233 <div class="col-md-5 contact-side-panel">
234 <div class="split-copy contact-help-panel">
235 <h2>
236 <i class="fa fa-check-circle" aria-hidden="true"></i>
237 How Agnease can help
238 </h2>
239
240 <ul>
241 <li>XWiki upgrades and long-term maintenance</li>
242 <li>Knowledge bases, intranets, SOP and documentation workflows</li>
243 <li>Custom XWiki applications and integrations</li>
244 <li>LDAP, SSO, OIDC, SAML, and MFA setup</li>
245 <li>Migrations from SharePoint, Confluence, MediaWiki, or file-based documentation</li>
246 <li>Security-aware reviews and platform stabilization</li>
247 </ul>
248 </div>
249
250 <ol class="process-list contact-process-list">
251 <li>
252 <strong>Your request is reviewed</strong>
253 The project description is checked to understand the context and initial scope.
254 </li>
255 <li>
256 <strong>You receive a reply</strong>
257 Agnease replies with clarifying questions or suggested next steps.
258 </li>
259 <li>
260 <strong>A short call can be scheduled</strong>
261 If useful, we discuss scope, timeline and estimated effort together.
262 </li>
263 </ol>
264 </div>
265 </div>
266 {{/html}}
267 {{/velocity}}