| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#!/usr/bin/perl -I/home/phil/perl/cpan/DataTableText/lib/ -I/home/phil/perl/cpan/DataEditXmlSDL/lib/ |
|
2
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
3
|
|
|
|
|
|
|
# Create SDL file map from a set of linted xml files |
|
4
|
|
|
|
|
|
|
# Philip R Brenan at gmail dot com, Appa Apps Ltd, 2016 |
|
5
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
6
|
|
|
|
|
|
|
# podDocumentation |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Data::Edit::Xml::SDL; |
|
9
|
1
|
|
|
1
|
|
473
|
use warnings FATAL => qw(all); |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
30
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
26
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use Carp qw(confess cluck); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
69
|
|
|
12
|
1
|
|
|
1
|
|
442
|
use Data::Dump qw(dump); |
|
|
1
|
|
|
|
|
6152
|
|
|
|
1
|
|
|
|
|
49
|
|
|
13
|
1
|
|
|
1
|
|
720
|
use Data::Edit::Xml::Lint; |
|
|
1
|
|
|
|
|
137863
|
|
|
|
1
|
|
|
|
|
84
|
|
|
14
|
1
|
|
|
1
|
|
19
|
use Data::Table::Text qw(:all); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
2670
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = 20200109; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#1 Constructor # Construct a new SDL file map creator |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new # Create a new SDL file map creator - call this method statically as in Data::Edit::Xml::Lint::new() |
|
20
|
1
|
|
|
1
|
1
|
19
|
{bless {sdlVersion=>'13.0.0.0', language=>(qq(en-US))} # Defaults that can be easily overridden |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#2 Attributes # Attributes describing a lint |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
genLValueScalarMethods(qw(filePathFolder)); # Prefix this folder (if supplied) to the filepath |
|
26
|
|
|
|
|
|
|
genLValueScalarMethods(qw(fileType)); # The fileType of the file to be processed |
|
27
|
|
|
|
|
|
|
genLValueScalarMethods(qw(filesFlattened)); # Files have been flattened if true |
|
28
|
|
|
|
|
|
|
genLValueScalarMethods(qw(folderHasMixedContent)); # folderHasMixedContent field |
|
29
|
|
|
|
|
|
|
genLValueScalarMethods(qw(ishType)); # IshType field |
|
30
|
|
|
|
|
|
|
genLValueScalarMethods(qw(imagePath)); # Image path relative to sourcebasepath |
|
31
|
|
|
|
|
|
|
genLValueScalarMethods(qw(language)); # The language of the content, defaults to: 'en-US' |
|
32
|
|
|
|
|
|
|
genLValueScalarMethods(qw(lint)); # The lint of the file to be processed |
|
33
|
|
|
|
|
|
|
genLValueScalarMethods(qw(sdlVersion)); # Version of SDL we are using, defaults to: '12.0.0.0' |
|
34
|
|
|
|
|
|
|
genLValueScalarMethods(qw(section)); # Sub folder for file on SDL: maps, topics |
|
35
|
|
|
|
|
|
|
genLValueScalarMethods(qw(sourcebasepath)); # Path to source to be uploaded |
|
36
|
|
|
|
|
|
|
genLValueScalarMethods(qw(targetFolder)); # Input: The SDL target folder to be used in the filemap - the person doing the upload will give this to you. |
|
37
|
|
|
|
|
|
|
genLValueScalarMethods(qw(version)); # Version of the input content |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#1 SDL File Map # Generate an SDL file map |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub xmlLineOne #P Line one of all xml files |
|
42
|
1
|
|
|
1
|
1
|
19
|
{''."\n" |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub getFileMap #P File map tag |
|
46
|
1
|
|
|
1
|
1
|
4
|
{my ($sdl) = @_; # Sdl file map creator |
|
47
|
1
|
|
|
|
|
89
|
my $s = $sdl->sourcebasepath; |
|
48
|
1
|
|
|
|
|
66
|
my $v = $sdl->sdlVersion; |
|
49
|
|
|
|
|
|
|
<
|
|
50
|
|
|
|
|
|
|
; |
|
51
|
|
|
|
|
|
|
END |
|
52
|
1
|
|
|
|
|
17
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub getFile($) #P File tag |
|
55
|
2
|
|
|
2
|
1
|
4
|
{my ($sdl) = @_; # Sdl file map creator |
|
56
|
2
|
|
|
|
|
33
|
my $targetFolder = $sdl->targetFolder; |
|
57
|
2
|
|
|
|
|
37
|
my $ishType = $sdl->ishType; |
|
58
|
2
|
|
|
|
|
30
|
my $section = $sdl->section; |
|
59
|
2
|
|
|
|
|
37
|
my $imagePath = $sdl->imagePath; |
|
60
|
2
|
|
|
|
|
31
|
my $lint = $sdl->lint; |
|
61
|
2
|
|
|
|
|
30
|
my $project = $lint->project; |
|
62
|
2
|
|
|
|
|
31
|
my $guid = $lint->guid; |
|
63
|
2
|
|
|
|
|
38
|
my $file = $lint->file; |
|
64
|
2
|
|
50
|
|
|
39
|
my $title = $lint->title || 'REQUIRED-CLEANUP-TITLE'; |
|
65
|
2
|
|
|
|
|
43
|
my $mixed = ucfirst $sdl->folderHasMixedContent; |
|
66
|
2
|
50
|
|
|
|
20
|
$mixed =~ m/\A(True|False)\Z/s or |
|
67
|
|
|
|
|
|
|
confess "FolderhasMixedContent = (True|False) not $mixed"; |
|
68
|
2
|
|
|
|
|
30
|
my $filePrefix = $lint->project; # File name prefix if any |
|
69
|
|
|
|
|
|
|
|
|
70
|
2
|
|
|
|
|
18
|
my (undef, $fileName, $fileExt) = parseFileName($file); # Parse file name |
|
71
|
2
|
50
|
|
|
|
55
|
$fileExt or confess "No file extension for ".$file; |
|
72
|
|
|
|
|
|
|
# my $relFile = filePathExt($filePrefix, $fileName, $fileExt); |
|
73
|
2
|
|
|
|
|
13
|
my $relFile = filePathExt($fileName, $fileExt); ## Fully flattened |
|
74
|
2
|
50
|
|
|
|
75
|
return <filesFlattened; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
END |
|
77
|
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
0
|
return <
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
END |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub getImageFile($) #P Image file tag |
|
84
|
0
|
|
|
0
|
0
|
0
|
{my ($sdl, $file) = @_; # Sdl file map creator, image file name |
|
85
|
0
|
|
|
|
|
0
|
my $targetFolder = $sdl->targetFolder; |
|
86
|
0
|
|
|
|
|
0
|
my $ishType = $sdl->ishType; |
|
87
|
0
|
|
|
|
|
0
|
my $section = $sdl->section; |
|
88
|
0
|
|
|
|
|
0
|
my $imagePath = $sdl->imagePath; |
|
89
|
0
|
|
|
|
|
0
|
my $project = "images"; |
|
90
|
0
|
|
|
|
|
0
|
my $guid = guidFromMd5(fn $file); |
|
91
|
0
|
|
|
|
|
0
|
my $mixed = ucfirst $sdl->folderHasMixedContent; |
|
92
|
0
|
0
|
|
|
|
0
|
$mixed =~ m/\A(True|False)\Z/s or |
|
93
|
|
|
|
|
|
|
confess "FolderhasMixedContent = (True|False) not $mixed"; |
|
94
|
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
0
|
my $filePrefix = filePathDir($imagePath); # The image file prefix if we are processing an image |
|
96
|
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
0
|
my (undef, $fileName, $fileExt) = parseFileName($file); # Parse file name |
|
98
|
|
|
|
|
|
|
# my $relFile = filePathExt($filePrefix, $fileName, $fileExt); |
|
99
|
0
|
|
|
|
|
0
|
my $relFile = filePathExt($fileName, $fileExt); ## Fully flattened |
|
100
|
0
|
|
|
|
|
0
|
my $r = <
|
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
END |
|
103
|
0
|
|
|
|
|
0
|
$r |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub getIshObject #P IshObject tag |
|
107
|
2
|
|
|
2
|
1
|
45
|
{my ($sdl) = @_; # Sdl |
|
108
|
2
|
|
|
|
|
30
|
my $ishType = $sdl->ishType; |
|
109
|
2
|
|
|
|
|
30
|
my $lint = $sdl->lint; |
|
110
|
2
|
|
|
|
|
30
|
my $guid = $lint->guid; |
|
111
|
2
|
50
|
|
|
|
9
|
$guid or confess "No guid supplied"; |
|
112
|
|
|
|
|
|
|
<
|
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
END |
|
115
|
2
|
|
|
|
|
15
|
} |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub getImageIshObject($$) #P IshObject tag for an image |
|
118
|
0
|
|
|
0
|
0
|
0
|
{my ($sdl, $file) = @_; # Sdl, image file |
|
119
|
0
|
|
|
|
|
0
|
my $ishType = $sdl->ishType; |
|
120
|
0
|
|
|
|
|
0
|
my $lint = $sdl->lint; |
|
121
|
0
|
|
|
|
|
0
|
my $guid = fn $file; |
|
122
|
|
|
|
|
|
|
<
|
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
END |
|
125
|
0
|
|
|
|
|
0
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub getFTitle($;$) #P FTITLE tag |
|
128
|
2
|
|
|
2
|
1
|
5
|
{my ($sdl, $imageFile) = @_; # Sdl, image file name which might have an image title following the md5 sum |
|
129
|
2
|
|
|
|
|
30
|
my $lint = $sdl->lint; # Lint |
|
130
|
2
|
|
|
|
|
30
|
my $Title = $lint->title; # Title |
|
131
|
|
|
|
|
|
|
|
|
132
|
2
|
50
|
|
|
|
8
|
if ($imageFile) # Image files some times have their titles after the md5 sum |
|
133
|
0
|
|
|
|
|
0
|
{my $i = $imageFile.q(.imageDef); |
|
134
|
0
|
0
|
|
|
|
0
|
if (-e $i) |
|
135
|
0
|
|
|
|
|
0
|
{$Title = readFile($i); |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# warn "No title in\n".dump($lint)."\n" unless $Title; |
|
140
|
2
|
|
50
|
|
|
5
|
my $title = $Title || 'REQUIRED-CLEANUP-TITLE'; |
|
141
|
|
|
|
|
|
|
<
|
|
142
|
|
|
|
|
|
|
$title |
|
143
|
|
|
|
|
|
|
END |
|
144
|
2
|
|
|
|
|
9
|
} |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub getVersion #P Version tag |
|
147
|
2
|
|
|
2
|
1
|
4
|
{my ($sdl) = @_; # Sdl |
|
148
|
2
|
|
|
|
|
28
|
my $v = $sdl->sdlVersion; |
|
149
|
|
|
|
|
|
|
<
|
|
150
|
|
|
|
|
|
|
$v |
|
151
|
|
|
|
|
|
|
END |
|
152
|
2
|
|
|
|
|
11
|
} |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub getDocLanguage #P DOC-LANGUAGE tag |
|
155
|
2
|
|
|
2
|
1
|
5
|
{my ($sdl) = @_; # Sdl |
|
156
|
2
|
|
|
|
|
27
|
my $l = $sdl->language; |
|
157
|
|
|
|
|
|
|
<
|
|
158
|
|
|
|
|
|
|
$l |
|
159
|
|
|
|
|
|
|
END |
|
160
|
2
|
|
|
|
|
24
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub getAuthor #P Author tag |
|
163
|
2
|
|
|
2
|
1
|
5
|
{my ($sdl) = @_; # Sdl |
|
164
|
2
|
|
|
|
|
28
|
my $lint = $sdl->lint; |
|
165
|
|
|
|
|
|
|
my $a = sub |
|
166
|
2
|
|
|
2
|
|
38
|
{my $a = $lint->author; |
|
167
|
2
|
50
|
|
|
|
10
|
return $a if $a; |
|
168
|
0
|
|
|
|
|
0
|
"bill.gearhart"; |
|
169
|
2
|
|
|
|
|
16
|
}->(); |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
<
|
|
172
|
|
|
|
|
|
|
$a |
|
173
|
|
|
|
|
|
|
END |
|
174
|
2
|
|
|
|
|
20
|
} |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub getResolution #P Resolution |
|
177
|
0
|
|
|
0
|
1
|
0
|
{my ($sdl) = @_; # Sdl |
|
178
|
|
|
|
|
|
|
<
|
|
179
|
|
|
|
|
|
|
High |
|
180
|
|
|
|
|
|
|
END |
|
181
|
0
|
|
|
|
|
0
|
} |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
sub createSDLFileMap($@) # Generate an SDL file map for a selected set of files |
|
184
|
1
|
|
|
1
|
1
|
5
|
{my ($sdl, @foldersAndExtensions) = @_; # Sdl, Directory tree search specification |
|
185
|
|
|
|
|
|
|
|
|
186
|
1
|
|
|
|
|
3
|
my @files = searchDirectoryTreesForMatchingFiles(@foldersAndExtensions); # Find matching files |
|
187
|
|
|
|
|
|
|
|
|
188
|
1
|
|
|
|
|
8011
|
my @map = (xmlLineOne, $sdl->getFileMap); # The generated map |
|
189
|
|
|
|
|
|
|
|
|
190
|
1
|
|
|
|
|
10
|
for my $file(@files) # Each file contributing to the map |
|
191
|
2
|
50
|
|
|
|
22
|
{next if $file =~ m(\.imageDef\Z)s; # Image definition files |
|
192
|
2
|
|
|
|
|
20
|
my $lint = Data::Edit::Xml::Lint::read($file); # Linter for the file |
|
193
|
2
|
|
|
|
|
2442
|
$sdl->lint = $lint; |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
my $ditaType = sub |
|
196
|
2
|
50
|
|
2
|
|
39
|
{return $lint->ditaType if $lint->ditaType; |
|
197
|
0
|
0
|
|
|
|
0
|
return q(bookmap) if fe($file) =~ m(ditamap)is; |
|
198
|
0
|
0
|
|
|
|
0
|
return q(image) if fe($file) =~ m((emf|gif|png|jpg|jpeg|pdf|tiff))is; |
|
199
|
0
|
0
|
|
|
|
0
|
return q(image) if fe($file) =~ m(imageDef); # File has been guidized the corresponding imageDef file tells us its original name |
|
200
|
0
|
|
|
|
|
0
|
undef; |
|
201
|
2
|
|
|
|
|
60
|
}->(); |
|
202
|
|
|
|
|
|
|
|
|
203
|
2
|
50
|
|
|
|
53
|
$ditaType or confess "DitaType required for file:\n$file"; |
|
204
|
|
|
|
|
|
|
|
|
205
|
2
|
100
|
|
|
|
29
|
if ($ditaType =~ m/map/i) |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
206
|
1
|
|
|
|
|
28
|
{$sdl->ishType = (qq(ISHMasterDoc)); |
|
207
|
1
|
|
|
|
|
29
|
$sdl->section = (qq(maps)); |
|
208
|
1
|
|
|
|
|
25
|
$sdl->folderHasMixedContent = (qq(true)); |
|
209
|
1
|
|
|
|
|
16
|
push @map, |
|
210
|
|
|
|
|
|
|
$sdl->getFile, |
|
211
|
|
|
|
|
|
|
$sdl->getIshObject, <
|
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
END |
|
214
|
|
|
|
|
|
|
$sdl->getFTitle, |
|
215
|
|
|
|
|
|
|
$sdl->getVersion, |
|
216
|
|
|
|
|
|
|
$sdl->getDocLanguage, |
|
217
|
|
|
|
|
|
|
$sdl->getAuthor, |
|
218
|
|
|
|
|
|
|
<
|
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
END |
|
223
|
|
|
|
|
|
|
} |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
elsif ($ditaType =~ m/concept|reference|task|troubleShooting/i) |
|
226
|
1
|
|
|
|
|
18
|
{$sdl->ishType = (qq(ISHModule)); |
|
227
|
1
|
|
|
|
|
16
|
$sdl->section = (qq(topics)); |
|
228
|
1
|
|
|
|
|
16
|
$sdl->folderHasMixedContent = (qq(true)); |
|
229
|
1
|
|
|
|
|
5
|
push @map, |
|
230
|
|
|
|
|
|
|
$sdl->getFile, |
|
231
|
|
|
|
|
|
|
$sdl->getIshObject, <
|
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
END |
|
234
|
|
|
|
|
|
|
$sdl->getFTitle, |
|
235
|
|
|
|
|
|
|
$sdl->getVersion, |
|
236
|
|
|
|
|
|
|
$sdl->getDocLanguage, |
|
237
|
|
|
|
|
|
|
$sdl->getAuthor, |
|
238
|
|
|
|
|
|
|
<
|
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
END |
|
243
|
|
|
|
|
|
|
} |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
elsif ($ditaType =~ m/image/i) |
|
246
|
0
|
|
|
|
|
0
|
{$sdl->ishType = qq(ISHIllustration); |
|
247
|
0
|
|
|
|
|
0
|
$sdl->section = qq(images); |
|
248
|
0
|
|
|
|
|
0
|
$sdl->imagePath = qq(images); |
|
249
|
0
|
|
|
|
|
0
|
$sdl->folderHasMixedContent = qq(false); |
|
250
|
0
|
|
|
|
|
0
|
push @map, |
|
251
|
|
|
|
|
|
|
$sdl->getImageFile($file), |
|
252
|
|
|
|
|
|
|
$sdl->getImageIshObject($file), <
|
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
END |
|
255
|
|
|
|
|
|
|
$sdl->getFTitle($file), |
|
256
|
|
|
|
|
|
|
$sdl->getVersion, |
|
257
|
|
|
|
|
|
|
$sdl->getDocLanguage, |
|
258
|
|
|
|
|
|
|
$sdl->getResolution, |
|
259
|
|
|
|
|
|
|
q(image), #$sdl->getAuthor, |
|
260
|
|
|
|
|
|
|
<
|
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
END |
|
265
|
|
|
|
|
|
|
} |
|
266
|
0
|
|
|
|
|
0
|
else {confess "Unrecognized ditaType $ditaType"} |
|
267
|
|
|
|
|
|
|
} |
|
268
|
1
|
|
|
|
|
15
|
my $T = dateTimeStamp; |
|
269
|
1
|
|
|
|
|
101
|
push @map, <
|
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
END |
|
273
|
1
|
|
|
|
|
35
|
join "", @map; |
|
274
|
|
|
|
|
|
|
} # createSDLFileMap |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
# podDocumentation |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=pod |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=encoding utf-8 |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head1 Name |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
Data::Edit::Xml::SDL - Create SDL file map from a set of linted xml files |
|
285
|
|
|
|
|
|
|
produced by L |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=head1 Synopsis |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
Create an SDL file map from a set of linted xml files produced by |
|
290
|
|
|
|
|
|
|
L |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
my $s = Data::Edit::Xml::SDL::new(); |
|
293
|
|
|
|
|
|
|
$s->sourcebasepath = 'C:\frame\batch1\out'; |
|
294
|
|
|
|
|
|
|
$s->targetFolder = qq(RyffineImportSGIfm); |
|
295
|
|
|
|
|
|
|
$s->imagePath = qq(images); |
|
296
|
|
|
|
|
|
|
$s->version = 1; |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
say STDERR $s->createSDLFileMap(qw(. xml)); |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
Produces: |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
; |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
bm_0003388-002' |
|
308
|
|
|
|
|
|
|
1 |
|
309
|
|
|
|
|
|
|
en-US |
|
310
|
|
|
|
|
|
|
bill.gearhart@hpe.com |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
etc. |
|
316
|
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 Description |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=head2 Constructor |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Construct a new SDL file map creator |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=head3 new() |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
Create a new SDL file map creator - call this method statically as in Data::Edit::Xml::Lint::new() |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head3 Attributes |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Attributes describing a lint |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head4 filePathFolder :lvalue |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
Prefix this folder (if supplied) to the filepath |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=head4 fileType :lvalue |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
The fileType of the file to be processed |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=head4 folderHasMixedContent :lvalue |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
folderHasMixedContent field |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=head4 ishType :lvalue |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
IshType field |
|
350
|
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=head4 imagePath :lvalue |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
Image path relative to sourcebasepath |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=head4 language :lvalue |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
The language of the content, defaults to: 'en-US' |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=head4 lint :lvalue |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
The lint of the file to be processed |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=head4 sdlVersion :lvalue |
|
368
|
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
Version of SDL we are using, defaults to: '12.0.0.0' |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=head4 section :lvalue |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
Sub folder for file on SDL: maps, topics |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=head4 sourcebasepath :lvalue |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
Path to source to be uploaded |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=head4 targetFolder :lvalue |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
The SDL target folder to be used |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=head4 version :lvalue |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
Version of the input content |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=head2 SDL File Map |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Generate an SDL file map |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=head3 createSDLFileMap($@) |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
Generate an SDL file map for a selected set of files |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
1 $sdl Sdl |
|
401
|
|
|
|
|
|
|
2 @foldersAndExtensions Directory tree search specification |
|
402
|
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=head1 Private Methods |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=head2 xmlLineOne() |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
Line one of all xml files |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=head2 getFileMap() |
|
412
|
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
File map tag |
|
414
|
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=head2 getFile($$) |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
File tag |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
1 $sdl Sdl file map creator |
|
421
|
|
|
|
|
|
|
2 $images Processing an image file or not |
|
422
|
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=head2 getIshObject() |
|
424
|
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
IshObject tag |
|
426
|
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
=head2 getFTitle() |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
FTITLE tag |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=head2 getVersion() |
|
434
|
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
Version tag |
|
436
|
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
=head2 getDocLanguage() |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
DOC-LANGUAGE tag |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=head2 getAuthor() |
|
444
|
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
Author tag |
|
446
|
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
=head2 getResolution() |
|
449
|
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
Resolution |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
=head1 Index |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
L |
|
458
|
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
L |
|
460
|
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
L |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
L |
|
464
|
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
L |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
L |
|
468
|
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
L |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
L |
|
472
|
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
L |
|
474
|
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
L |
|
476
|
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
L |
|
478
|
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
L |
|
480
|
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
L |
|
482
|
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
L |
|
484
|
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
L |
|
486
|
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
L |
|
488
|
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
L |
|
490
|
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
L |
|
492
|
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
L |
|
494
|
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
L |
|
496
|
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
L |
|
498
|
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
L |
|
500
|
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
L |
|
502
|
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
=head1 Installation |
|
504
|
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
This module is written in 100% Pure Perl and, thus, it is easy to read, use, |
|
506
|
|
|
|
|
|
|
modify and install. |
|
507
|
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
Standard Module::Build process for building and installing modules: |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
perl Build.PL |
|
511
|
|
|
|
|
|
|
./Build |
|
512
|
|
|
|
|
|
|
./Build test |
|
513
|
|
|
|
|
|
|
./Build install |
|
514
|
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
=head1 Author |
|
516
|
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
L |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
L |
|
520
|
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
=head1 Copyright |
|
522
|
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
Copyright (c) 2016-2017 Philip R Brenan. |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
This module is free software. It may be used, redistributed and/or modified |
|
526
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
527
|
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=cut |
|
529
|
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
# Tests and documentation |
|
532
|
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
sub test |
|
534
|
1
|
|
|
1
|
0
|
5
|
{my $p = __PACKAGE__; |
|
535
|
1
|
50
|
|
|
|
84
|
return if eval "eof(${p}::DATA)"; |
|
536
|
1
|
|
|
|
|
51
|
my $s = eval "join('', <${p}::DATA>)"; |
|
537
|
1
|
50
|
|
|
|
6
|
$@ and die $@; |
|
538
|
1
|
|
|
1
|
0
|
5
|
eval $s; |
|
|
1
|
|
|
1
|
0
|
2
|
|
|
|
1
|
|
|
1
|
0
|
33
|
|
|
|
1
|
|
|
1
|
0
|
5
|
|
|
|
1
|
|
|
1
|
0
|
1
|
|
|
|
1
|
|
|
1
|
|
18
|
|
|
|
1
|
|
|
1
|
|
517
|
|
|
|
1
|
|
|
3
|
|
52563
|
|
|
|
1
|
|
|
|
|
11
|
|
|
|
1
|
|
|
|
|
62
|
|
|
|
1
|
|
|
|
|
15
|
|
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
183
|
|
|
|
3
|
|
|
|
|
7
|
|
|
539
|
1
|
50
|
|
|
|
604
|
$@ and die $@; |
|
540
|
|
|
|
|
|
|
} |
|
541
|
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
test unless caller; |
|
543
|
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
1; |
|
545
|
|
|
|
|
|
|
# podDocumentation |
|
546
|
|
|
|
|
|
|
__DATA__ |