File: AdminGenericInterfaceErrorHandlingRequestRetry.tt

package info (click to toggle)
otrs2 6.0.32-6
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 197,336 kB
  • sloc: perl: 1,003,018; javascript: 75,060; xml: 70,883; php: 51,819; sql: 22,361; sh: 379; makefile: 51
file content (396 lines) | stat: -rw-r--r-- 25,158 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# --
# Copyright (C) 2001-2021 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1 class="InvisibleText">[% Translate( "GenericInterface Web Service Management" ) | html %]</h1>

    [% USE WebserviceLink = String("AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=") %]

    [% BreadcrumbPath = [
            {
                Name => Translate( 'Web Service Management' ),
                Link => BreadcrumbLink,
            },
            {
                Name => Data.WebserviceName,
                Link => WebserviceLink.append( Data.WebserviceID ),
            },
        ]
    %]

    [% SWITCH Data.Action %]
        [% CASE 'Add' %]
            [% USE AddTitle = String(Translate("Add ErrorHandling")) %]
            [% BreadcrumbPath.push({ Name => AddTitle.append( ': ', Data.ErrorHandlingType ), }) %]
        [% CASE 'Change' %]
            [% USE EditTitle = String(Translate("Edit ErrorHandling")) %]
            [% BreadcrumbPath.push({ Name => EditTitle.append( ': ', Data.ErrorHandlingType ), }) %]
    [% END %]

    [% INCLUDE "Breadcrumb.tt" Path = BreadcrumbPath %]

    <div class="SidebarColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("Actions") | html %]</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <li>
                        <a href="[% Env("Baselink") %]Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=[% Data.WebserviceID | uri %]" class="CallForAction Fullsize Center"><span><i class="fa fa-caret-left"></i> [% Translate("Go back to web service") | html %]</span></a>
                    </li>
[% IF Data.Action == 'Change' %]
                    <li>
                        <button class="CallForAction Fullsize Center" type="button" id="DeleteButton"><span> <i class="fa fa-trash-o"></i> [% Translate("Delete") | html %]</span></button>
                        <div class="Hidden" id="DeleteDialogContainer">
                            <span class="WarningDialog ">&nbsp;</span>
                            <p id="DeleteDialog" class="Center Warning">
                                [% Translate("Do you really want to delete this error handling module?") | html %]
                            </p>
                            <p class="Center Warning">
                                [% Translate("All configuration data will be lost.") | html %]
                            </p>
                            <div class="SpacingTop"></div>
                        </div>
                    </li>
[% END %]
                </ul>
            </div>
        </div>
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("Hint") | html %]</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    [% Translate("This module allows to configure scheduled retries for failed requests.") | html %]
                </p>
                <p class="FieldExplanation">
                    [% Translate("Default behavior of GenericInterface web services is to send each request exactly once and not to reschedule after errors.") | html %]
                </p>
                <p class="FieldExplanation">
                    [% Translate("If more than one module capable of scheduling a retry is executed for an individual request, the module executed last is authoritative and determines if a retry is scheduled.") | html %]
                </p>
            </div>
        </div>
    </div>
    <div class="ContentColumn">

        <form action="[% Env("CGIHandle") %]" class="Validate" method="post">
            <input type="hidden" name="Action" value="AdminGenericInterfaceErrorHandlingRequestRetry" />
            <input type="hidden" name="Subaction" value="[% Data.Action | html %]Action" />
            <input type="hidden" id="WebserviceID" name="WebserviceID" value="[% Data.WebserviceID | html %]" />
            <input type="hidden" name="CommunicationType" value="[% Data.CommunicationType | html %]" />
            <input type="hidden" name="ErrorHandlingType" value="[% Data.ErrorHandlingType | html %]" />
            [% IF Data.Action == 'Change' %]
                <input type="hidden" name="ContinueAfterSave" id="ContinueAfterSave" value=""/>
            [% END %]

            <!-- General options -->
            <div class="WidgetSimple Expanded">
                <div class="Header">
                    <div class="WidgetAction Toggle">
                        <a href="#" title="[% Translate("Show or hide the content") | html %]"><i class="fa fa-caret-right"></i><i class="fa fa-caret-down"></i></a>
                    </div>
                    <h2>[% Translate("General options") | html %]</h2>
                </div>
                <div class="Content">

                    <fieldset class="TableLike">
                        <label for="ErrorHandling" class="Mandatory">
                            <span class="Marker">*</span>
                            [% Translate("Name") | html %]:
                        </label>
                        <div class="Field">
                            <input type="text" class="W50pc Validate_Required [% Data.ErrorHandlingServerError | html %]" maxlength="200" id="ErrorHandling" name="ErrorHandling" value="[% Data.ErrorHandling | html %]" />
                            <input type="hidden" name="OldErrorHandling" value="[% Data.OldErrorHandling | html %]" />
                            <p class="FieldExplanation">
                                [% Translate("The name can be used to distinguish different error handling configurations.") | html %]
                            </p>
                            <div id="ErrorHandlingError" class="TooltipErrorMessage">
                                [% Translate("Please provide a unique name for this web service.") | html %]
                            </div>
                            <div id="ErrorHandlingServerError" class="TooltipErrorMessage">
                                [% Translate("The name you entered already exists.") | html %]
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="Description">
                            [% Translate("Description") | html %]:
                        </label>
                        <div class="Field">
                            <input type="text" class="W50pc" maxlength="200" id="Description" name="Description" value="[% Data.Description | html %]" />
                        </div>
                        <div class="Clear"></div>

                        <label for="ErrorHandlingTypeDisplay">[% Translate("Error handling module backend") | html %]:</label>
                        <div class="Field">
                            <input type="text" readonly="readonly" class="W50pc" id="ErrorHandlingTypeDisplay" value="[% Data.ErrorHandlingType | html %]" />
                            <p class="FieldExplanation">
                                [% Translate("This OTRS error handling backend module will be called internally to process the error handling mechanism.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                    </fieldset>
                </div>
            </div>

            <!-- Processing options -->
            <div class="WidgetSimple Expanded">
                <div class="Header">
                    <div class="WidgetAction Toggle">
                        <a href="#" title="[% Translate("Show or hide the content") | html %]"><i class="fa fa-caret-right"></i><i class="fa fa-caret-down"></i></a>
                    </div>
                    <h2>[% Translate("Processing options") | html %]</h2>
                </div>
                <div class="Content">

                    <fieldset class="TableLike">

                        <div class="Field">
                            [% Translate("Configure filters to control error handling module execution.") | html %]
                            <p class="FieldExplanation">
                                [% Translate("Only requests matching all configured filters (if any) will trigger module execution.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

[% RenderBlockStart("OperationFilter") %]
                        <label for="OperationFilter">
                            [% Translate("Operation filter") | html %]:
                        </label>
                        <div class="Field">
                            [% Data.OperationFilterStrg %]
                            <p class="FieldExplanation">
                                [% Translate("Only execute error handling module for selected operations.") | html %]<br/>
                                [% Translate("Note: Operation is undetermined for errors occuring while receiving incoming request data. Filters involving this error stage should not use operation filter.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>
[% RenderBlockEnd("OperationFilter") %]
[% RenderBlockStart("InvokerFilter") %]
                        <label for="InvokerFilter">
                            [% Translate("Invoker filter") | html %]:
                        </label>
                        <div class="Field">
                            [% Data.InvokerFilterStrg %]
                            <p class="FieldExplanation">
                                [% Translate("Only execute error handling module for selected invokers.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>
[% RenderBlockEnd("InvokerFilter") %]

                        <label for="ErrorMessageContentFilter">
                            [% Translate("Error message content filter") | html %]:
                        </label>
                        <div class="Field">
                            <input type="text" class="W50pc [% Data.ErrorMessageContentFilterServerError | html %]" maxlength="200" id="ErrorMessageContentFilter" name="ErrorMessageContentFilter" value="[% Data.ErrorMessageContentFilter | html %]" />
                            <input type="hidden" id="ErrorMessageContentFilter" name="ErrorMessageContentFilter" value="[% Data.ErrorMessageContentFilter | html %]" />
                            <p class="FieldExplanation">
                                [% Translate("Enter a regular expression to restrict which error messages should cause error handling module execution.") | html %]<br/>
                                [% Translate("Error message subject and data (as seen in the debugger error entry) will considered for a match.") | html %]<br/>
                                [% Translate("Example: Enter '^.*401 Unauthorized.*\$' to handle only authentication related errors.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="ErrorStageFilter">
                            [% Translate("Error stage filter") | html %]:
                        </label>
                        <div class="Field">
                            [% Data.ErrorStageFilterStrg %]
                            <p class="FieldExplanation">
                                [% Translate("Only execute error handling module on errors that occur during specific processing stages.") | html %]<br/>
                                [% Translate("Example: Handle only errors where mapping for outgoing data could not be applied.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="ErrorCode">
                            [% Translate("Error code") | html %]:
                        </label>
                        <div class="Field">
                            <input type="text" class="W50pc" maxlength="200" id="ErrorCode" name="ErrorCode" value="[% Data.ErrorCode | html %]" />
                            <p class="FieldExplanation">
                                [% Translate("An error identifier for this error handling module.") | html %]<br/>
                                [% Translate("This identifier will be available in XSLT-Mapping and shown in debugger output.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="ErrorMessage">
                            [% Translate("Error message") | html %]:
                        </label>
                        <div class="Field">
                            <input type="text" class="W50pc" maxlength="200" id="ErrorMessage" name="ErrorMessage" value="[% Data.ErrorMessage | html %]" />
                            <p class="FieldExplanation">
                                [% Translate("An error explanation for this error handling module.") | html %]<br/>
                                [% Translate("This message will be available in XSLT-Mapping and shown in debugger output.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="StopAfterMatch">
                            [% Translate("Stop after match") | html %]:
                        </label>
                        <div class="Field">
                            [% Data.StopAfterMatchStrg %]
                            <p class="FieldExplanation">
                                [% Translate("Define if processing should be stopped after module was executed, skipping all remaining modules or only those of the same backend.") | html %]<br/>
                                [% Translate("Default behavior is to resume, processing the next module.") | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>

                    </fieldset>
                </div>
            </div>

            <!-- Request retry specific options -->
            <div class="WidgetSimple Expanded">
                <div class="Header">
                    <div class="WidgetAction Toggle">
                        <a href="#" title="[% Translate("Show or hide the content") | html %]"><i class="fa fa-caret-right"></i><i class="fa fa-caret-down"></i></a>
                    </div>
                    <h2>[% Translate("Request retry options") | html %]</h2>
                </div>
                <div class="Content">

                    <fieldset class="TableLike">

                        <div class="Field">
                            [% Translate("Retry options are applied when requests cause error handling module execution (based on processing options).") | html %]
                        </div>
                        <div class="Clear"></div>

                        <label for="ScheduleRetry" class="Mandatory">
                            <span class="Marker">*</span>
                            [% Translate("Schedule retry") | html %]:
                        </label>
                        <div class="Field">
                            [% Data.ScheduleRetryStrg %]
                            <p class="FieldExplanation">
                                [% Translate("Should requests causing an error be triggered again at a later time?") | html %]
                            </p>
                            <div id="ScheduleRetryError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                        </div>
                        <div class="Clear"></div>

                        <div id="ScheduleRetryFields" class="[% Data.ScheduleRetryFieldsHidden | html %]">
                            <fieldset class="TableLike">

                                <label for="RetryIntervalStart" class="Mandatory">
                                    <span class="Marker">*</span>
                                    [% Translate("Initial retry interval") | html %]:
                                </label>
                                <div class="Field">
                                    [% Data.RetryIntervalStartStrg %]
                                    <p class="FieldExplanation">
                                        [% Translate("Interval after which to trigger the first retry.") | html %]<br />
                                        [% Translate("Note: This and all further retry intervals are based on the error handling module execution time for the initial request.") | html %]
                                    </p>
                                    <div id="RetryIntervalStartError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                </div>
                                <div class="Clear"></div>

                                <label for="RetryIntervalFactor" class="Mandatory">
                                    <span class="Marker">*</span>
                                    [% Translate("Factor for further retries") | html %]:
                                </label>
                                <div class="Field">
                                    [% Data.RetryIntervalFactorStrg %]
                                    <p class="FieldExplanation">
                                        [% Translate("If a request returns an error even after a first retry, define if subsequent retries are triggered using the same interval or in increasing intervals.") | html %]<br />
                                        [% Translate("Example: If a request is initially triggered at 10:00 with initial interval at '1 minute' and retry factor at '2', retries would be triggered at 10:01 (1 minute), 10:03 (2*1=2 minutes), 10:07 (2*2=4 minutes), 10:15 (2*4=8 minutes), ...") | html %]
                                    </p>
                                    <div id="RetryIntervalFactorError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                </div>
                                <div class="Clear"></div>

                                <label for="RetryIntervalMax" class="Mandatory">
                                    <span class="Marker">*</span>
                                    [% Translate("Maximum retry interval") | html %]:
                                </label>
                                <div class="Field">
                                    [% Data.RetryIntervalMaxStrg %]
                                    <p class="FieldExplanation">
                                        [% Translate("If a retry interval factor of '1.5' or '2' is selected, undesirably long intervals can be prevented by defining the largest interval allowed.") | html %]<br />
                                        [% Translate("Intervals calculated to exceed the maximum retry interval will then automatically be shortened accordingly.") | html %]<br />
                                        [% Translate("Example: If a request is initially triggered at 10:00 with initial interval at '1 minute', retry factor at '2' and maximum interval at '5 minutes', retries would be triggered at 10:01 (1 minute), 10:03 (2 minutes), 10:07 (4 minutes), 10:12 (8=>5 minutes), 10:17, ...") | html %]<br />
                                    </p>
                                    <div id="RetryIntervalMaxError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                </div>
                                <div class="Clear"></div>

                                <label for="RetryCountMax">
                                    [% Translate("Maximum retry count") | html %]:
                                </label>
                                <div class="Field">
                                    <input type="text" class="W50pc Validate_Number [% Data.RetryCountMaxServerError | html %]" maxlength="200" id="RetryCountMax" name="RetryCountMax" value="[% Data.RetryCountMax | html %]" />
                                    <input type="hidden" id="RetryCountMax" name="RetryCountMax" value="[% Data.RetryCountMax | html %]" />
                                    <p class="FieldExplanation">
                                        [% Translate("Maximum number of retries before a failing request is discarded, not counting the initial request.") | html %]<br />
                                        [% Translate("Example: If a request is initially triggered at 10:00 with initial interval at '1 minute', retry factor at '2' and maximum retry count at '2', retries would be triggered at 10:01 and 10:02 only.") | html %]<br />
                                        [% Translate("Note: Maximum retry count might not be reached if a maximum retry period is configured as well and reached earlier.") | html %]
                                    </p>
                                    <div id="RetryCountMaxServerError" class="TooltipErrorMessage"><p>[% Translate("This field must be empty or contain a positive number.") | html %]</p></div>
                                </div>
                                <div class="Clear"></div>

                                <label for="RetryPeriodMax">
                                    [% Translate("Maximum retry period") | html %]:
                                </label>
                                <div class="Field">
                                    [% Data.RetryPeriodMaxStrg %]
                                    <p class="FieldExplanation">
                                        [% Translate("Maximum period of time for retries of failing requests before they are discarded (based on the error handling module execution time for the initial request).") | html %]<br />
                                        [% Translate("Retries that would normally be triggered after maximum period is elapsed (according to retry interval calculation) will automatically be triggered at maximum period exactly.") | html %]<br />
                                        [% Translate("Example: If a request is initially triggered at 10:00 with initial interval at '1 minute', retry factor at '2' and maximum retry period at '30 minutes', retries would be triggered at 10:01, 10:03, 10:07, 10:15 and finally at 10:31=>10:30.") | html %]<br />
                                        [% Translate("Note: Maximum retry period might not be reached if a maximum retry count is configured as well and reached earlier.") | html %]
                                    </p>
                                </div>
                                <div class="Clear"></div>

                            </fieldset>
                        </div>

                    </fieldset>
                </div>
            </div>

            <!-- Submit options -->
            <div class="WidgetSimple">
                <div class="Header">
                    <h2>[% Translate("Submit") | html %]</h2>
                </div>
                <div class="Content">

                    <fieldset class="TableLike">

                        <div class="Field SpacingTop">
                            [% IF Data.Action == 'Change' %]
                                <button class="CallForAction Primary" id="SubmitAndContinue" type="button" value="[% Translate("Save") | html %]"><span>[% Translate("Save") | html %]</span></button>
                                [% Translate("or") | html %]
                                <button class="CallForAction Primary" id="Submit" type="submit" value="[% Translate("Save") | html %]"><span>[% Translate("Save and finish") | html %]</span></button>
                            [% ELSE %]
                                <button class="CallForAction Primary" id="Submit" type="submit" value="[% Translate("Save") | html %]"><span>[% Translate("Save") | html %]</span></button>
                            [% END %]
                            [% Translate("or") | html %]
                            <a href="[% Env("Baselink") %]Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=[% Data.WebserviceID | uri %]"><span>[% Translate("Cancel") | html %]</span></a>
                        </div>
                        <div class="Clear"></div>

                    </fieldset>
                </div>
            </div>
        </form>
    </div>
    <div class="Clear"></div>
</div>