Version 18.15 by Alex Cotiuga on 2026/07/09 20:28

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