origami 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,558 @@
1
+ =begin
2
+
3
+ This file is part of Origami, PDF manipulation framework for Ruby
4
+ Copyright (C) 2017 Guillaume Delugré.
5
+
6
+ Origami is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ Origami is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with Origami. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ =end
20
+
21
+ module Origami
22
+
23
+ module XDP
24
+
25
+ module Packet
26
+
27
+ #
28
+ # This packet encloses the configuration settings.
29
+ #
30
+ class Config < XFA::Element
31
+ mime_type 'text/xml'
32
+
33
+ def initialize
34
+ super("config")
35
+
36
+ add_attribute 'xmlns:xfa', 'http://www.xfa.org/schema/xci/3.0/'
37
+ end
38
+
39
+ class URI < XFA::Element
40
+ xfa_attribute 'desc'
41
+ xfa_attribute 'lock'
42
+
43
+ def initialize(uri = "")
44
+ super('uri')
45
+
46
+ self.text = uri
47
+ end
48
+ end
49
+
50
+ class Debug < XFA::Element
51
+ xfa_attribute 'desc'
52
+ xfa_attribute 'lock'
53
+
54
+ xfa_node 'uri', Config::URI, 0..1
55
+
56
+ def initialize
57
+ super('debug')
58
+ end
59
+ end
60
+
61
+ class AdjustData < XFA::Element
62
+ xfa_attribute 'desc'
63
+ xfa_attribute 'lock'
64
+
65
+ def initialize(coercion = "0")
66
+ super('adjustData')
67
+
68
+ self.text = coercion
69
+ end
70
+ end
71
+
72
+ class Attributes < XFA::Element
73
+ xfa_attribute 'desc'
74
+ xfa_attribute 'lock'
75
+
76
+ PRESERVE = "preserve"
77
+ DELEGATE = "delegate"
78
+ IGNORE = "ignore"
79
+
80
+ def initialize(attr = PRESERVE)
81
+ super('attributes')
82
+
83
+ self.text = attr
84
+ end
85
+ end
86
+
87
+ class IncrementalLoad < XFA::Element
88
+ xfa_attribute 'desc'
89
+ xfa_attribute 'lock'
90
+
91
+ NONE = "none"
92
+ FORWARDONLY = "forwardOnly"
93
+
94
+ def initialize(incload = NONE)
95
+ super('incrementalLoad')
96
+
97
+ self.text = incload
98
+ end
99
+ end
100
+
101
+ class Locale < XFA::Element
102
+ xfa_attribute 'desc'
103
+ xfa_attribute 'lock'
104
+
105
+ def initialize(locale = "")
106
+ super('locale')
107
+
108
+ self.text = locale
109
+ end
110
+ end
111
+
112
+ class LocaleSet < XFA::Element
113
+ xfa_attribute 'desc'
114
+ xfa_attribute 'lock'
115
+
116
+ def initialize(uri = "")
117
+ super('localeSet')
118
+
119
+ self.text = uri
120
+ end
121
+ end
122
+
123
+ class OutputXSL < XFA::Element
124
+ xfa_attribute 'desc'
125
+ xfa_attribute 'lock'
126
+
127
+ xfa_node 'uri', Config::URI, 0..1
128
+
129
+ def initialize
130
+ super('outputXSL')
131
+ end
132
+ end
133
+
134
+ class Range < XFA::Element
135
+ xfa_attribute 'desc'
136
+ xfa_attribute 'lock'
137
+
138
+ def initialize(range = "")
139
+ super('range')
140
+
141
+ self.text = range
142
+ end
143
+ end
144
+
145
+ class Record < XFA::Element
146
+ xfa_attribute 'desc'
147
+ xfa_attribute 'lock'
148
+
149
+ def initialize(record = "")
150
+ super('record')
151
+
152
+ self.text = record
153
+ end
154
+ end
155
+
156
+ class StartNode < XFA::Element
157
+ xfa_attribute 'desc'
158
+ xfa_attribute 'lock'
159
+
160
+ def initialize(somexpr = "")
161
+ super('startNode')
162
+
163
+ self.text = somexpr
164
+ end
165
+ end
166
+
167
+ class Window < XFA::Element
168
+ xfa_attribute 'desc'
169
+ xfa_attribute 'lock'
170
+
171
+ def initialize(win = "0")
172
+ super('window')
173
+
174
+ self.text = win
175
+ end
176
+ end
177
+
178
+ class XSL < XFA::Element
179
+ xfa_attribute 'desc'
180
+ xfa_attribute 'lock'
181
+
182
+ xfa_node 'debug', Config::Debug, 0..1
183
+ xfa_node 'uri', Config::URI, 0..1
184
+
185
+ def initialize
186
+ super('xsl')
187
+ end
188
+ end
189
+
190
+ class ExcludeNS < XFA::Element
191
+ xfa_attribute 'desc'
192
+ xfa_attribute 'lock'
193
+
194
+ def initialize(ns = "")
195
+ super('excludeNS')
196
+
197
+ self.text = ns
198
+ end
199
+ end
200
+
201
+ class GroupParent < XFA::Element
202
+ xfa_attribute 'desc'
203
+ xfa_attribute 'lock'
204
+
205
+ def initialize(parentname = "")
206
+ super('groupParent')
207
+
208
+ self.text = parentname
209
+ end
210
+ end
211
+
212
+ class IfEmpty < XFA::Element
213
+ xfa_attribute 'desc'
214
+ xfa_attribute 'lock'
215
+
216
+ DATAVALUE = "dataValue"
217
+ DATAGROUP = "dataGroup"
218
+ IGNORE = "ignore"
219
+ REMOVE = "remove"
220
+
221
+ def initialize(default = DATAVALUE)
222
+ super('ifEmpty')
223
+
224
+ self.text = default
225
+ end
226
+ end
227
+
228
+ class NameAttr < XFA::Element
229
+ xfa_attribute 'desc'
230
+ xfa_attribute 'lock'
231
+
232
+ def initialize(name)
233
+ super('nameAttr')
234
+
235
+ self.text = name
236
+ end
237
+ end
238
+
239
+ class Picture < XFA::Element
240
+ xfa_attribute 'desc'
241
+ xfa_attribute 'lock'
242
+
243
+ def initialize(clause = "")
244
+ super('picture')
245
+
246
+ self.text = clause
247
+ end
248
+ end
249
+
250
+ class Presence < XFA::Element
251
+ xfa_attribute 'desc'
252
+ xfa_attribute 'lock'
253
+
254
+ PRESERVE = "preserve"
255
+ DISSOLVE = "dissolve"
256
+ DISSOLVESTRUCTURE = "dissolveStructure"
257
+ IGNORE = "ignore"
258
+ REMOVE = "remove"
259
+
260
+ def initialize(action = PRESERVE)
261
+ super('presence')
262
+
263
+ self.text = action
264
+ end
265
+ end
266
+
267
+ class Rename < XFA::Element
268
+ xfa_attribute 'desc'
269
+ xfa_attribute 'lock'
270
+
271
+ def initialize(nodename = "")
272
+ super('rename')
273
+
274
+ self.text = nodename
275
+ end
276
+ end
277
+
278
+ class Whitespace < XFA::Element
279
+ xfa_attribute 'desc'
280
+ xfa_attribute 'lock'
281
+
282
+ PRESERVE = "preserve"
283
+ LTRIM = "ltrim"
284
+ NORMALIZE = "normalize"
285
+ RTRIM = "rtrim"
286
+ TRIM = "trim"
287
+
288
+ def initialize(action = PRESERVE)
289
+ super('whitespace')
290
+
291
+ self.text = action
292
+ end
293
+ end
294
+
295
+ class Transform < XFA::Element
296
+ xfa_attribute 'desc'
297
+ xfa_attribute 'lock'
298
+ xfa_attribute 'ref'
299
+
300
+ xfa_node 'groupParent', Config::GroupParent, 0..1
301
+ xfa_node 'ifEmpty', Config::IfEmpty, 0..1
302
+ xfa_node 'nameAttr', Config::NameAttr, 0..1
303
+ xfa_node 'picture', Config::Picture, 0..1
304
+ xfa_node 'presence', Config::Presence, 0..1
305
+ xfa_node 'rename', Config::Rename, 0..1
306
+ xfa_node 'whitespace', Config::Whitespace, 0..1
307
+ end
308
+
309
+ class Data < XFA::Element
310
+ xfa_attribute 'desc'
311
+ xfa_attribute 'lock'
312
+
313
+ xfa_node 'adjustData', Config::AdjustData, 0..1
314
+ xfa_node 'attributes', Config::Attributes, 0..1
315
+ xfa_node 'incrementalLoad', Config::IncrementalLoad, 0..1
316
+ xfa_node 'outputXSL', Config::OutputXSL, 0..1
317
+ xfa_node 'range', Config::Range, 0..1
318
+ xfa_node 'record', Config::Record, 0..1
319
+ xfa_node 'startNode', Config::StartNode, 0..1
320
+ xfa_node 'uri', Config::URI, 0..1
321
+ xfa_node 'window', Config::Window, 0..1
322
+ xfa_node 'xsl', Config::XSL, 0..1
323
+
324
+ xfa_node 'excludeNS', Config::ExcludeNS
325
+ xfa_node 'transform', Config::Transform
326
+
327
+ def initialize
328
+ super('data')
329
+ end
330
+ end
331
+
332
+ class Severity < XFA::Element
333
+ xfa_attribute 'desc'
334
+ xfa_attribute 'lock'
335
+
336
+ IGNORE = "ignore"
337
+ ERROR = "error"
338
+ INFORMATION = "information"
339
+ TRACE = "trace"
340
+ WARNING = "warning"
341
+
342
+ def initialize(level = IGNORE)
343
+ super('severity')
344
+
345
+ self.text = level
346
+ end
347
+ end
348
+
349
+ class MsgId < XFA::Element
350
+ xfa_attribute 'desc'
351
+ xfa_attribute 'lock'
352
+
353
+ def initialize(uid = "1")
354
+ super('msgId')
355
+
356
+ self.text = uid
357
+ end
358
+ end
359
+
360
+ class Message < XFA::Element
361
+ xfa_attribute 'desc'
362
+ xfa_attribute 'lock'
363
+
364
+ xfa_node 'msgId', Config::MsgId, 0..1
365
+ xfa_node 'severity', Config::Severity, 0..1
366
+
367
+ def initialize
368
+ super('message')
369
+ end
370
+ end
371
+
372
+ class Messaging < XFA::Element
373
+ xfa_attribute 'desc'
374
+ xfa_attribute 'lock'
375
+
376
+ xfa_node 'message', Config::Message
377
+
378
+ def initialize
379
+ super('messaging')
380
+ end
381
+ end
382
+
383
+ class SuppressBanner < XFA::Element
384
+ xfa_attribute 'desc'
385
+ xfa_attribute 'lock'
386
+
387
+ ALLOWED = "0"
388
+ DENIED = "1"
389
+
390
+ def initialize(display = ALLOWED)
391
+ super('suppressBanner')
392
+
393
+ self.text = display
394
+ end
395
+ end
396
+
397
+ class Base < XFA::Element
398
+ xfa_attribute 'desc'
399
+ xfa_attribute 'lock'
400
+
401
+ def initialize(uri = "")
402
+ super('base')
403
+
404
+ self.text = uri
405
+ end
406
+ end
407
+
408
+ class Relevant < XFA::Element
409
+ xfa_attribute 'desc'
410
+ xfa_attribute 'lock'
411
+
412
+ def initialize(token = "")
413
+ super('relevant')
414
+
415
+ self.text = token
416
+ end
417
+ end
418
+
419
+ class StartPage < XFA::Element
420
+ xfa_attribute 'desc'
421
+ xfa_attribute 'lock'
422
+
423
+ def initialize(pagenum = "0")
424
+ super('startPage')
425
+
426
+ self.text = pagenum
427
+ end
428
+ end
429
+
430
+ class Template < XFA::Element
431
+ xfa_attribute 'desc'
432
+ xfa_attribute 'lock'
433
+
434
+ xfa_node 'base', Config::Base, 0..1
435
+ xfa_node 'relevant', Config::Relevant, 0..1
436
+ xfa_node 'startPage', Config::StartPage, 0..1
437
+ xfa_node 'uri', Config::URI, 0..1
438
+ xfa_node 'xsl', Config::XSL, 0..1
439
+
440
+ def initialize
441
+ super('template')
442
+ end
443
+ end
444
+
445
+ class ValidationMessaging < XFA::Element
446
+ xfa_attribute 'desc'
447
+ xfa_attribute 'lock'
448
+
449
+ ALL_INDIVIDUALLY = "allMessagesIndividually"
450
+ ALL_TOGETHER = "allMessagesTogether"
451
+ FIRST_ONLY = "firstMessageOnly"
452
+ NONE = "noMessages"
453
+
454
+ def initialize(validate = ALL_INDIVIDUALLY)
455
+ super('validationMessaging')
456
+
457
+ self.text = validate
458
+ end
459
+ end
460
+
461
+ class VersionControl < XFA::Element
462
+ xfa_attribute 'lock'
463
+ xfa_attribute 'outputBelow'
464
+ xfa_attribute 'sourceAbove'
465
+ xfa_attribute 'sourceBelow'
466
+
467
+ def initialize
468
+ super('versionControl')
469
+ end
470
+ end
471
+
472
+ class Mode < XFA::Element
473
+ xfa_attribute 'desc'
474
+ xfa_attribute 'lock'
475
+
476
+ APPEND = "append"
477
+ OVERWRITE = "overwrite"
478
+
479
+ def initialize(mode = APPEND)
480
+ super('mode')
481
+
482
+ self.text = mode
483
+ end
484
+ end
485
+
486
+ class Threshold < XFA::Element
487
+ xfa_attribute 'desc'
488
+ xfa_attribute 'lock'
489
+
490
+ TRACE = "trace"
491
+ ERROR = "error"
492
+ INFORMATION = "information"
493
+ WARN = "warn"
494
+
495
+ def initialize(threshold = TRACE)
496
+ super('threshold')
497
+
498
+ self.text = threshold
499
+ end
500
+ end
501
+
502
+ class To < XFA::Element
503
+ xfa_attribute 'desc'
504
+ xfa_attribute 'lock'
505
+
506
+ NULL = "null"
507
+ MEMORY = "memory"
508
+ STD_ERR = "stderr"
509
+ STD_OUT = "stdout"
510
+ SYSTEM = "system"
511
+ URI = "uri"
512
+
513
+ def initialize(dest = NULL)
514
+ super('to')
515
+
516
+ self.text = dest
517
+ end
518
+ end
519
+
520
+ class Log < XFA::Element
521
+ xfa_attribute 'desc'
522
+ xfa_attribute 'lock'
523
+
524
+ xfa_node 'mode', Config::Mode, 0..1
525
+ xfa_node 'threshold', Config::Threshold, 0..1
526
+ xfa_node 'to', Config::To, 0..1
527
+ xfa_node 'uri', Config::URI, 0..1
528
+
529
+ def initialize
530
+ super('log')
531
+ end
532
+ end
533
+
534
+ class Common < XFA::Element
535
+ xfa_attribute 'desc'
536
+ xfa_attribute 'lock'
537
+
538
+ xfa_node 'data', Config::Data, 0..1
539
+ xfa_node 'locale', Config::Locale, 0..1
540
+ xfa_node 'localeSet', Config::LocaleSet, 0..1
541
+ xfa_node 'messaging', Config::Messaging, 0..1
542
+ xfa_node 'suppressBanner', Config::SuppressBanner, 0..1
543
+ xfa_node 'template', Config::Template, 0..1
544
+ xfa_node 'validationMessaging', Config::ValidationMessaging, 0..1
545
+ xfa_node 'versionControl', Config::VersionControl, 0..1
546
+
547
+ xfa_node 'log', Config::Log
548
+
549
+ def initialize
550
+ super("common")
551
+ end
552
+ end
553
+
554
+ end
555
+
556
+ end
557
+ end
558
+ end