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
|
# --
# Copyright (C) 2001-2019 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 AdminGenericInterfaceMappingXSLT">
<h1 class="InvisibleText">[% Translate( "GenericInterface Web Service Management" ) | html %]</h1>
[% USE WebserviceLink = String( "AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=" ) %]
[% USE ActionName = String( Data.ActionType ) %]
[% USE ActionLink = String( Data.ActionFrontendModule ) %]
[% BreadcrumbPath = [
{
Name => Translate( 'Web Service Management' ),
Link => 'AdminGenericInterfaceWebservice',
},
{
Name => Data.WebserviceName,
Link => WebserviceLink.append( Data.WebserviceID ),
},
{
Name => ActionName.append( ': ', Data.Action ),
Link => ActionLink.append( ';Subaction=Change;', Data.ActionType, '=', Data.Action, ';WebserviceID=', Data.WebserviceID ),
},
{
Name => Data.MappingDirection,
},
]
%]
[% INCLUDE "Breadcrumb.tt" Path = BreadcrumbPath %]
<div class="Clear"></div>
<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=[% Data.ActionFrontendModule | uri %];Subaction=Change;[% Data.ActionType | uri %]=[% Data.Action | uri %];WebserviceID=[% Data.WebserviceID | uri %]" class="CallForAction Fullsize Center">
<span><i class="fa fa-caret-left"></i> [% Translate("Go back to") | html %] [% Data.LowerCaseActionType | html %]</span>
</a>
</li>
</ul>
</div>
</div>
<div class="WidgetSimple Tabs StickyElement">
<div class="Header">
<a href="#General" class="Active">[% Translate("General Shortcuts") | html %]</a>
<a href="#MacOS">[% Translate("MacOS Shortcuts") | html %]</a>
</div>
<div class="Content">
<div data-id="General" class="Active">
<ul class="ShortCuts">
<li>
<em>
<span>Ctrl</span><span>K</span>
</em>
<em>[% Translate("Comment code") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Shift</span><span>K</span>
</em>
<em>[% Translate("Uncomment code") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Alt</span><span>K</span>
</em>
<em>[% Translate("Auto format code") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Q</span>
</em>
<em>[% Translate("Expand/Collapse code block") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>F</span>
</em>
<em>[% Translate("Find") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>G</span>
</em>
<em>[% Translate("Find next") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Shift</span><span>G</span>
</em>
<em>[% Translate("Find previous") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Shift</span><span>F</span>
</em>
<em>[% Translate("Find and replace") | html %]</em>
</li>
<li>
<em>
<span>Ctrl</span><span>Shift</span><span>R</span>
</em>
<em>[% Translate("Find and replace all") | html %]</em>
</li>
</ul>
</div>
<div data-id="MacOS">
<ul class="ShortCuts">
<li>
<em>
<span>Cmd</span><span>K</span>
</em>
<em>[% Translate("Comment code") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>Shift</span><span>K</span>
</em>
<em>[% Translate("Uncomment code") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>Alt</span><span>K</span>
</em>
<em>[% Translate("Auto format code") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>F</span>
</em>
<em>[% Translate("Find") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>G</span>
</em>
<em>[% Translate("Find next") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>Shift</span><span>G</span>
</em>
<em>[% Translate("Find previous") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>Shift</span><span>F</span>
</em>
<em>[% Translate("Find and replace") | html %]</em>
</li>
<li>
<em>
<span>Cmd</span><span>Shift</span><span>R</span>
</em>
<em>[% Translate("Find and replace all") | html %]</em>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="ContentColumn">
<form action="[% Env("CGIHandle") %]" method="post" class="Validate PreventMultipleSubmits" id="XSLTConfig">
<input type="hidden" name="Action" value="[% Env("Action") %]"/>
<input type="hidden" name="Subaction" value="[% Data.Subaction | html %]Action"/>
<input type="hidden" name="WebserviceID" value="[% Data.WebserviceID | html %]" id="WebserviceID"/>
<input type="hidden" name="CommunicationType" value="[% Data.CommunicationType | html %]" />
<input type="hidden" name="Operation" value="[% Data.Operation | html %]" />
<input type="hidden" name="Invoker" value="[% Data.Invoker | html %]" />
<input type="hidden" name="Direction" value="[% Data.Direction | html %]"/>
[% IF Data.Subaction == 'Change' %]
<input type="hidden" name="ContinueAfterSave" id="ContinueAfterSave" value=""/>
[% END %]
[% RenderBlockStart("ConfigBlock") %]
[% RenderBlockStart("ConfigBlockTemplate") %]
<div class="WidgetSimple">
<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("XSLT Mapping") | html %]</h2>
</div>
<div class="Content">
<fieldset class="TableLike FixedLabel">
<label class="Mandatory" for="Template"><span class="Marker">*</span>[% Translate("XSLT stylesheet") | html %]:</label>
<div class="Field">
<textarea id="Template" name="Template" rows="20" cols="80" class="RichText Validate_Required [% Data.TemplateError | html %]">[% Data.Template | html %]</textarea>
<div id="TemplateServerError" class="TooltipErrorMessage">
<p>[% Translate("The entered data is not a valid XSLT style sheet.") | html %]</p>
</div>
<p class="FieldExplanation">
[% Translate("Here you can add or modify your XSLT mapping code.") | html %]
</p>
<p class="FieldExplanation">
[% Translate("The editing field allows you to use different functions like automatic formatting, window resize as well as tag- and bracket-completion.") | html %]
</p>
</div>
<div class="Clear"/>
</fieldset>
<fieldset class="TableLike FixedLabel">
<label for="DataInclude">[% Translate("Data includes") | html %]:</label>
<div class="Field">
[% Data.DataIncludeSelect %]
<p class="FieldExplanation">[% Translate("Select one or more sets of data that were created at earlier request/response stages to be included in mappable data.") | html %]</p>
<p class="FieldExplanation">[% Translate("These sets will appear in the data structure at '/DataInclude/<DataSetName>' (see debugger output of actual requests for details).") | html %]</p>
</div>
<div class="Clear"/>
</fieldset>
</div>
</div>
[% RenderBlockEnd("ConfigBlockTemplate") %]
[% RenderBlockStart("ConfigBlockRegExFilter") %]
<div class="WidgetSimple [% Data.Collapsed | html %]" id="WidgetRegExFilters[% Data.Type | html %]">
<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>
[% IF Data.Type == 'Pre' %]
<h2>[% Translate("Data key regex filters (before mapping)") | html %]</h2>
[% ELSE %]
<h2>[% Translate("Data key regex filters (after mapping)") | html %]</h2>
[% END %]
</div>
<div class="Content">
<fieldset class="TableLike FixedLabel">
<label for="Filter">[% Translate("Regular expressions") | html %]:</label>
<div class="Field [% Data.Type | html %]ValueInsert">
<input type="hidden" name="[% Data.Type | html %]ValueCounter" value="[% Data.ValueCounter | html %]" id="[% Data.Type | html %]ValueCounter" class="ValueCounter" />
[% RenderBlockStart("ValueRow") %]
<div class="ValueRow">
<label class="Mandatory" for="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]"><span class="Marker">*</span>[% Translate("Search") | html %]:</label>
<input name="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]" id="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]" class="Validate_Required W20pc [% Data.KeyError | html %]" type="text" maxlength="100" value="[% Data.Key | html %]"/>
<div id="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate(Data.KeyErrorStrg) | html %]</p></div>
<label for="[% Data.Type | html %]Value_[% Data.ValueCounter | html %]">[% Translate("Replace") | html %]:</label>
<input name="[% Data.Type | html %]Value_[% Data.ValueCounter | html %]" id="[% Data.Type | html %]Value_[% Data.ValueCounter | html %]" class="W20pc" type="text" maxlength="100" value="[% Data.Value | html %]"/>
<a href="#" id="[% Data.Type | html %]RemoveValue_[% Data.ValueCounter | html %]" class="RemoveButton ValueRemove"><i class="fa fa-minus-square-o"></i><span class="InvisibleText">[% Translate("Remove regex") | html %]</span></a>
<div class="SpacingTopMini" ></div>
</div>
[% RenderBlockEnd("ValueRow") %]
[% RenderBlockStart("ValueTemplate") %]
<div class="[% Data.Type | html %]ValueTemplate Hidden">
<label class="Mandatory" for="[% Data.Type | html %]Key"><span class="Marker">*</span>[% Translate("Search") | html %]:</label>
<input name="[% Data.Type | html %]Key_[% Data.ValueCounter | html %]" id="[% Data.Type | html %]Key" class="KeyTemplate W20pc" type="text" maxlength="100" value="[% Data.Key | html %]"/>
<div id="[% Data.Type | html %]KeyError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.Type | html %]KeyServerError" class="TooltipErrorMessage"><p>[% Translate(Data.KeyErrorStrg) | html %]</p></div>
<label for="[% Data.Type | html %]Value">[% Translate("Replace") | html %]:</label>
<input name="[% Data.Type | html %]Value_[% Data.ValueCounter | html %]" id="[% Data.Type | html %]Value" class="W20pc" type="text" maxlength="100" value="[% Data.Value | html %]"/>
<a href="#" id="[% Data.Type | html %]RemoveValue_[% Data.ValueCounter | html %]" class="RemoveButton ValueRemove"><i class="fa fa-minus-square-o"></i><span class="InvisibleText">[% Translate("Remove regex") | html %]</span></a>
</div>
[% RenderBlockEnd("ValueTemplate") %]
<input type="hidden" name="[% Data.Type | html %]DeletedValue" value="[% Data.DeletedString | html %]" id="[% Data.Type | html %]DeletedValue" class="[% Data.Type | html %]DeletedValue" />
</div>
<div class="Clear"></div>
<label for="[% Data.Type | html %]AddValue">[% Translate("Add regex") | html %]:</label>
<div class="Field">
<a href="#" id="[% Data.Type | html %]AddValue" class="AddButton"><i class="fa fa-plus-square-o"></i><span class="InvisibleText">[% Translate("Add regex") | html %]</span></a>
<p class="FieldExplanation">[% Translate("These filters can be used to transform keys using regular expressions.") | html %]</p>
<p class="FieldExplanation">[% Translate("The data structure will be traversed recursively and all configured regexes will be applied to all keys.") | html %]</p>
<p class="FieldExplanation">[% Translate("Use cases are e.g. removing key prefixes that are undesired or correcting keys that are invalid as XML element names.") | html %]</p>
<p class="FieldExplanation">[% Translate("Example 1: Search = '^jira:' / Replace = '' turns 'jira:element' into 'element'.") | html %]</p>
<p class="FieldExplanation">[% Translate("Example 2: Search = '^' / Replace = '_' turns '16x16' into '_16x16'.") | html %]</p>
<p class="FieldExplanation">[% Translate("Example 3: Search = '^(?<number>\d+) (?<text>.+?)\$' / Replace = '_\$+{text}_\$+{number}' turns '16 elementname' into '_elementname_16'.") | html %]</p>
<p class="FieldExplanation">
[% Translate("For information about regular expressions in Perl please see here:") | html %]
<a href="https://perldoc.perl.org/perlretut.html" target="_blank">[% Translate("Perl regular expressions tutorial") | html %]</a>
</p>
<p class="FieldExplanation">[% Translate("If modifiers are desired they have to be specified within the regexes themselves.") | html %]</p>
[% IF Data.Type == 'Pre' %]
<p class="FieldExplanation">[% Translate("Regular expressions defined here will be applied before the XSLT mapping.") | html %]</p>
[% ELSE %]
<p class="FieldExplanation">[% Translate("Regular expressions defined here will be applied after the XSLT mapping.") | html %]</p>
[% END %]
</div>
<div class="Clear"></div>
</fieldset>
</div>
</div>
[% RenderBlockEnd("ConfigBlockRegExFilter") %]
[% RenderBlockEnd("ConfigBlock") %]
<fieldset class="TableLike">
<div class="Field SpacingTop">
[% IF Data.Subaction == '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=[% Data.ActionFrontendModule | uri %];Subaction=Change;[% Data.ActionType | uri %]=[% Data.Action | uri %];WebserviceID=[% Data.WebserviceID | uri %]"><span>[% Translate("Cancel") | html %]</span></a>
</div>
<div class="Clear"></div>
</fieldset>
</form>
</div>
</div>
|