Version 18.23 by Alex Cotiuga on 2026/07/09 20:39

Hide last authors
Alex Cotiuga 13.108 1 {{velocity wiki="false"}}
2 #if ($xcontext.action == 'get')
Alex Cotiuga 16.12 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.')
Alex Cotiuga 13.189 5
Alex Cotiuga 16.57 6 #set ($className = 'Agnease.Code.ContactRequest.ContactRequestClass')
7 #set ($allowedProperties = [
8 'scope',
9 'alreadyUseXWiki',
10 'name',
11 'email',
12 'hosting',
13 'customDevelopment',
14 'timeline',
Alex Cotiuga 18.6 15 'users',
16 'sourcePage'
Alex Cotiuga 16.57 17 ])
18
Alex Cotiuga 16.12 19 #set ($name = '')
20 #set ($email = '')
Alex Cotiuga 16.51 21 #set ($scope = '')
Alex Cotiuga 16.26 22 #set ($contactWebsite = '')
Alex Cotiuga 16.45 23 #set ($startedAtRaw = '')
Alex Cotiuga 13.168 24
Alex Cotiuga 16.57 25 ## Extract only the values we need for validation.
Alex Cotiuga 13.150 26 #foreach ($parameterName in $request.parameterNames)
Alex Cotiuga 16.36 27 #set ($propertyParts = $parameterName.split('_0_'))
Alex Cotiuga 16.38 28 #if ($propertyParts.size() > 1)
Alex Cotiuga 16.57 29 #set ($propertyName = $propertyParts[1])
30 #set ($propertyValue = $stringtool.trim($request.get($parameterName)))
31
Alex Cotiuga 16.36 32 #if ($propertyName == 'name')
Alex Cotiuga 16.57 33 #set ($name = $propertyValue)
Alex Cotiuga 16.36 34 #elseif ($propertyName == 'email')
Alex Cotiuga 16.57 35 #set ($email = $propertyValue)
Alex Cotiuga 16.51 36 #elseif ($propertyName == 'scope')
Alex Cotiuga 16.57 37 #set ($scope = $propertyValue)
Alex Cotiuga 16.36 38 #elseif ($propertyName == 'contactWebsite')
Alex Cotiuga 16.57 39 #set ($contactWebsite = $propertyValue)
Alex Cotiuga 16.42 40 #elseif ($propertyName == 'contactStartedAt')
Alex Cotiuga 16.57 41 #set ($startedAtRaw = $propertyValue)
Alex Cotiuga 16.36 42 #end
Alex Cotiuga 16.12 43 #end
Alex Cotiuga 13.150 44 #end
Alex Cotiuga 13.170 45
Alex Cotiuga 16.57 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
Alex Cotiuga 16.46 58 #set ($startedAt = $numbertool.toNumber($startedAtRaw))
Alex Cotiuga 16.57 59 #if ("$!startedAt" == '')
60 #set ($spamScore = $spamScore + 2)
61 #else
62 #set ($now = $datetool.systemDate.time)
63 #set ($elapsed = $now - $startedAt)
Alex Cotiuga 16.46 64
Alex Cotiuga 16.57 65 ## Reject very fast submissions.
66 #if ($elapsed > 0 && $elapsed < 10000)
67 #set ($spamScore = $spamScore + 3)
68 #end
Alex Cotiuga 16.46 69 #end
Alex Cotiuga 16.57 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" == '')
Alex Cotiuga 16.12 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.')
Alex Cotiuga 16.51 110 #elseif ("$!scope" == '' || $scope.length() < 30)
111 #set ($message = 'Please add a short description of your XWiki project, question or issue.')
Alex Cotiuga 16.57 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.')
Alex Cotiuga 16.12 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))
Alex Cotiuga 16.57 120 #set ($contactRequestObj = $contactRequestDoc.getObject($className, true))
Alex Cotiuga 15.26 121
Alex Cotiuga 16.57 122 ## Save only known ContactRequest fields.
Alex Cotiuga 16.12 123 #foreach ($parameterName in $request.parameterNames)
Alex Cotiuga 18.14 124 #if ($parameterName == 'sourcePage')
Alex Cotiuga 18.22 125 #set ($discard = $contactRequestObj.set($parameterName, $stringtool.trim($request.get($parameterName))))
Alex Cotiuga 18.14 126 #end
Alex Cotiuga 16.57 127 #set ($propertyParts = $parameterName.split('_0_'))
128 #if ($propertyParts.size() > 1)
129 #set ($propertyName = $propertyParts[1])
130
131 #if ($allowedProperties.contains($propertyName))
Alex Cotiuga 18.14 132 #set ($discard = $contactRequestObj.set($propertyName, $stringtool.trim($request.get($parameterName))))
Alex Cotiuga 16.57 133 #end
Alex Cotiuga 16.54 134 #end
Alex Cotiuga 16.12 135 #end
Alex Cotiuga 13.108 136
Alex Cotiuga 16.12 137 #set ($discard = $contactRequestDoc.saveAsAuthor())
138 #set ($statusCode = 200)
139 #set ($message = 'Your request was successfully sent.')
140 #end
Alex Cotiuga 13.108 141
Alex Cotiuga 16.12 142 #if ("$!contactException" != '')
143 #set ($statusCode = 400)
144 #set ($message = 'The request could not be sent. Please try again or contact Agnease by email.')
145 #end
146 #end
147
Alex Cotiuga 13.108 148 #set ($discard = $response.setStatus($statusCode))
Alex Cotiuga 13.151 149 #jsonResponse({'message': $message})
Alex Cotiuga 13.108 150 #end
151 {{/velocity}}
152
Alex Cotiuga 2.6 153 {{velocity}}
Alex Cotiuga 13.3 154 #set ($discard = $xwiki.ssx.use('contact.WebHome'))
Alex Cotiuga 14.5 155 #set ($xobject = $doc.getObject('Agnease.Code.ContactRequest.ContactRequestClass'))
Alex Cotiuga 15.26 156 #set ($totalRequests = $services.query.xwql('from doc.object(Agnease.Code.ContactRequest.ContactRequestClass) contact').execute())
Alex Cotiuga 15.34 157 #set ($xclass = $xobject.xWikiClass)
158 #set ($editing = true)
159 = Tell Us More About Your Project =
160 You do not need to have a full specification. A short description is enough to start the conversation.
Alex Cotiuga 16.8 161 {{html clean="false"}}
Alex Cotiuga 16.11 162 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.
Alex Cotiuga 15.34 163 <div class="row">
164 <div class="xform col-md-7">
Alex Cotiuga 15.37 165 #if ($totalRequests.size() > 50)
Alex Cotiuga 15.34 166 ## As a measure to avoid high load on website.
Alex Cotiuga 15.35 167 Tell us more about your project at <a href="mailto:alex@agnease.com">alex@agnease.com</a>
Alex Cotiuga 15.34 168 #else
Alex Cotiuga 18.7 169 #set ($hiddenProperties = ['sourcePage'])
Alex Cotiuga 15.30 170 <form id="contactForm">
171 <dl>
172 #foreach ($property in $xclass.properties)
Alex Cotiuga 18.8 173 #set ($hiddenPropertiesCSS = '')
Alex Cotiuga 18.7 174 #if ($hiddenProperties.contains($property.name))
Alex Cotiuga 18.8 175 #set ($hiddenPropertiesCSS = 'class="hidden"')
Alex Cotiuga 18.7 176 #end
Alex Cotiuga 15.30 177 #if ($property.name == 'hosting')
178 <hr>
179 <h3>Optional project details</h3>
180 <p>These details help us understand the scope and suggest practical next steps.</p>
181 #end
Alex Cotiuga 18.8 182 <dt $hiddenPropertiesCSS #if (!$editing && $hasEdit)
Alex Cotiuga 18.7 183 class="editableProperty"
184 #set ($xobjectPropertyReference = $xobject.getPropertyReference($property.name))
185 data-property="$escapetool.xml($services.model.serialize($xobjectPropertyReference))"
186 data-property-type="object"#end>
187 ## This must match the id generated by the $doc.display() method below.
188 #set ($propertyId = "${xclass.name}_${xobject.number}_$property.name")
189 <label#if ($editing) for="$escapetool.xml($propertyId)"#end>
190 $escapetool.xml($property.translatedPrettyName)
191 </label>
192 ## Support for specifying a translation key as hint in the property definition.
193 <span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
194 </dt>
Alex Cotiuga 18.9 195 <dd $hiddenPropertiesCSS>$doc.display($property.name, 'edit').replace('{{html clean="false" wiki="false"}}', '').replace("{{/html}}", '')</dd>
Alex Cotiuga 13.47 196 #end
Alex Cotiuga 15.30 197 #if (!$xclass.properties || $xclass.properties.size() == 0)
198 ## Keep the empty definition term in order to have valid HTML.
199 <dt></dt>
Alex Cotiuga 18.9 200 <dd>$escapetool.xml($services.localization.render('xclass.defaultObjectSheet.noProperties'))</dd>
Alex Cotiuga 15.30 201 #end
202 </dl>
Alex Cotiuga 16.6 203 <p class="xHint">* Your information will only be used to respond to this request.</p>
Alex Cotiuga 16.16 204 ## Hidden fields to catch requests filled by bots.
205 <div class="contact-hp-wrapper" aria-hidden="true">
Alex Cotiuga 16.31 206 <label for="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite">Website</label>
Alex Cotiuga 16.16 207 <input
Alex Cotiuga 16.58 208 id="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite"
Alex Cotiuga 16.16 209 type="text"
Alex Cotiuga 16.31 210 name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite"
Alex Cotiuga 16.16 211 autocomplete="off"
212 tabindex="-1"
213 />
214 </div>
Alex Cotiuga 16.49 215 <input type="hidden" name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactStartedAt" value="$datetool.systemDate.time" />
Alex Cotiuga 18.23 216 <input type="hidden" name="sourcePage" value="" />
Alex Cotiuga 15.30 217 <input id="contactSubmit" type="submit" class="btn btn-primary" value="Send my request">
218 </form>
Alex Cotiuga 15.34 219 #end
220 {{/html}}
221 {{html clean="false" wiki="true"}}
222 <div class="reviewNotifications">
223 <div class="hidden reviewNotificationSuccess">
Alex Cotiuga 13.104 224
Alex Cotiuga 15.34 225 {{success}}reviewNotification{{/success}}
Alex Cotiuga 13.104 226
Alex Cotiuga 15.34 227 </div>
228 <div class="hidden reviewNotificationError">
Alex Cotiuga 13.104 229
Alex Cotiuga 15.34 230 {{error}}reviewNotification{{/error}}
Alex Cotiuga 13.104 231
Alex Cotiuga 13.107 232 </div>
Alex Cotiuga 13.104 233 </div>
Alex Cotiuga 15.34 234 {{/html}}
235 {{html clean="false"}}
236 </div>
Alex Cotiuga 17.2 237 <div class="col-md-5 contact-side-panel">
238 <div class="split-copy contact-help-panel">
239 <h2>
240 <i class="fa fa-check-circle" aria-hidden="true"></i>
241 How Agnease can help
242 </h2>
243
Alex Cotiuga 15.34 244 <ul>
245 <li>XWiki upgrades and long-term maintenance</li>
246 <li>Knowledge bases, intranets, SOP and documentation workflows</li>
247 <li>Custom XWiki applications and integrations</li>
248 <li>LDAP, SSO, OIDC, SAML, and MFA setup</li>
249 <li>Migrations from SharePoint, Confluence, MediaWiki, or file-based documentation</li>
250 <li>Security-aware reviews and platform stabilization</li>
251 </ul>
Alex Cotiuga 12.21 252 </div>
Alex Cotiuga 17.2 253
254 <ol class="process-list contact-process-list">
255 <li>
256 <strong>Your request is reviewed</strong>
257 The project description is checked to understand the context and initial scope.
258 </li>
259 <li>
260 <strong>You receive a reply</strong>
261 Agnease replies with clarifying questions or suggested next steps.
262 </li>
263 <li>
264 <strong>A short call can be scheduled</strong>
265 If useful, we discuss scope, timeline and estimated effort together.
266 </li>
267 </ol>
Alex Cotiuga 12.14 268 </div>
Alex Cotiuga 15.34 269 </div>
270 {{/html}}
Alex Cotiuga 2.6 271 {{/velocity}}