Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZSOFTCOPY_O2                                     *
3
*&                                                                     *
4
*&---------------------------------------------------------------------*
5
*&                                                                     *
6
*& This file is part of ZSOFTCOPY.                                     *
7
*&                                                                     *
8
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
9
*& it under the terms of the GNU General Public License as published   *
10
*& by the Free Software Foundation, either version 3 of the License,   *
11
*& or any later version.                                               *
12
*&                                                                     *
13
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
14
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16
*& GNU General Public License for more details.                        *
17
*&                                                                     *
18
*& You should have received a copy of the GNU General Public License   *
19
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
20
*&                                                                     *
21
*&---------------------------------------------------------------------*
22
*&                                                                     *
23
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
24
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
25
*&                                                                     *
26
*&---------------------------------------------------------------------*
27
 
28
 
29
*-----------------------------------------------------------------------
30
* o2
31
*-----------------------------------------------------------------------
32
FORM o2.
33
*BSP Application
34
  PERFORM o2_r3tr_wapa.
35
*BSP Applications
36
  PERFORM o2_r3tr_wapa_appl.
37
*Mimes
38
  PERFORM o2_r3tr_wapa_mime.
39
*BSP Extension
40
  PERFORM o2_r3tr_wtag.
41
*BSP Extensions
42
  PERFORM o2_r3tr_wtag_ext.
43
*XSLT
44
  PERFORM o2_r3tr_xslt.
45
 
46
ENDFORM.                    "o2
47
 
48
 
49
*-----------------------------------------------------------------------
50
* o2_get_mime_content
51
*-----------------------------------------------------------------------
52
FORM o2_get_mime_content
53
  USING
54
    value(i_objtype)
55
    value(i_class)
56
    value(i_objid)
57
  CHANGING
58
    ct_content_ascii TYPE it_o2content_ascii
59
    ct_content_binary TYPE it_o2content_binary
60
    c_filesize TYPE i.
61
 
62
  DATA:
63
  lo_io TYPE REF TO data,
64
  lo_phio TYPE REF TO data,
65
  lo_error TYPE REF TO data,
66
  lt_class_filter TYPE it_o2class_filter,
67
  lt_relation TYPE it_o2relation,
68
  lt_file_info TYPE it_o2file_info.
69
 
70
  FIELD-SYMBOLS:
71
  <ls_io> TYPE ANY,
72
  <ls_phio> TYPE ANY,
73
  <ls_error> TYPE ANY,
74
  <l_fs> TYPE ANY,
75
  <ls_relation> TYPE st_o2relation,
76
  <ls_file_info> TYPE st_o2file_info.
77
 
78
  CREATE DATA lo_io TYPE ('SKWF_IO').
79
  ASSIGN lo_io->* TO <ls_io>.
80
  CREATE DATA lo_phio TYPE ('SKWF_IO').
81
  ASSIGN lo_phio->* TO <ls_phio>.
82
  CREATE DATA lo_error TYPE ('SKWF_ERROR').
83
  ASSIGN lo_error->* TO <ls_error>.
84
 
85
  ASSIGN COMPONENT 'OBJTYPE' OF STRUCTURE <ls_io> TO <l_fs>.
86
  <l_fs> = i_objtype.
87
  ASSIGN COMPONENT 'CLASS' OF STRUCTURE <ls_io> TO <l_fs>.
88
  <l_fs> = i_class.
89
  ASSIGN COMPONENT 'OBJID' OF STRUCTURE <ls_io> TO <l_fs>.
90
  <l_fs> = i_objid.
91
 
92
  CALL FUNCTION 'SKWF_IO_FROM_RELATIONS_GET'
93
    EXPORTING
94
      io           = <ls_io>
95
    IMPORTING
96
      error        = <ls_error>
97
    TABLES
98
      class_filter = lt_class_filter
99
      relations    = lt_relation.
100
  CHECK <ls_error> IS INITIAL.
101
 
102
  LOOP AT lt_relation ASSIGNING <ls_relation>.
103
    CLEAR <ls_error>.
104
    ASSIGN COMPONENT 'OBJTYPE' OF STRUCTURE <ls_phio> TO <l_fs>.
105
    <l_fs> = <ls_relation>-objtype.
106
    ASSIGN COMPONENT 'CLASS' OF STRUCTURE <ls_phio> TO <l_fs>.
107
    <l_fs> = <ls_relation>-prtn_class.
108
    ASSIGN COMPONENT 'OBJID' OF STRUCTURE <ls_phio> TO <l_fs>.
109
    <l_fs> = <ls_relation>-prtn_id.
110
    CALL FUNCTION 'SKWF_PHIO_LOAD_CONTENT'
111
      EXPORTING
112
        phio                = <ls_phio>
113
      IMPORTING
114
        error               = <ls_error>
115
      TABLES
116
        file_access_info    = lt_file_info
117
        file_content_ascii  = ct_content_ascii
118
        file_content_binary = ct_content_binary.
119
    LOOP AT lt_file_info ASSIGNING <ls_file_info>.
120
      c_filesize = <ls_file_info>-file_size.
121
    ENDLOOP.
122
  ENDLOOP.
123
ENDFORM.                    "get_mime_content
124
 
125
 
126
*-----------------------------------------------------------------------
127
* o2_get_mimes
128
*-----------------------------------------------------------------------
129
FORM o2_get_mimes
130
  USING value(i_folder_name)
131
  CHANGING ct_mime TYPE it_mime.
132
 
133
  DATA:
134
  l_folder_name1(4096) TYPE c,
135
  l_folder_name2(4096) TYPE c,
136
  ls_folder TYPE st_skwf_io,
137
  ls_error TYPE st_skwf_error,
138
  ls_parent TYPE st_skwf_io,
139
  lt_io TYPE it_skwf_io,
140
  ls_io TYPE st_skwf_io,
141
  l_prefix(4096) TYPE c,
142
  l_len TYPE i,
143
  ls_mime TYPE st_mime,
144
  l_url(4096) TYPE c,
145
  l_rel_url(64) TYPE c,
146
  l_filename(255) TYPE c,
147
  l_url_prefix TYPE seovalue.
148
 
149
  REFRESH ct_mime.
150
 
151
  PERFORM get_class_attribute_value
152
    USING
153
      'CL_WB_MIME_REPOSITORY'
154
      'MR_URL_PREFIX'
155
    CHANGING
156
      l_url_prefix.
157
  IF l_url_prefix IS INITIAL.
158
    l_url_prefix = '/'.
159
  ENDIF.
160
 
161
  CONCATENATE l_url_prefix 'SAP' INTO l_url.
162
  CALL FUNCTION 'SKWF_NMSPC_IO_FIND_BY_ADDRESS'
163
    EXPORTING
164
      url   = l_url
165
      appl  = 'MIME'
166
    IMPORTING
167
      io    = ls_parent
168
      error = ls_error.
169
  IF NOT ls_parent IS INITIAL.
170
    l_folder_name1 = i_folder_name.
171
    DO.
172
      IF l_folder_name1 CS '/'.
173
        SPLIT l_folder_name1 AT '/' INTO l_folder_name2 l_folder_name1.
174
      ELSE.
175
        l_folder_name2 = l_folder_name1.
176
      ENDIF.
177
      CALL FUNCTION 'SKWF_NMSPC_IO_FIND_BY_ADDRESS'
178
        EXPORTING
179
          url    = l_folder_name2
180
          folder = ls_parent
181
        IMPORTING
182
          io     = ls_folder
183
          error  = ls_error.
184
      IF ls_folder IS INITIAL
185
      OR l_folder_name2 = l_folder_name1.
186
        EXIT.
187
      ENDIF.
188
      ls_parent = ls_folder.
189
    ENDDO.
190
    IF NOT ls_folder IS INITIAL.
191
      CALL FUNCTION 'SKWF_FOLDER_SUB_IOS_GET'
192
        EXPORTING
193
          folder  = ls_folder
194
          io_type = 'L'
195
        IMPORTING
196
          error   = ls_error
197
        TABLES
198
          ios     = lt_io.
199
      IF ls_error IS INITIAL.
200
        CONCATENATE l_url_prefix 'SAP/' i_folder_name '/'
201
            INTO l_prefix.
202
        l_len = strlen( l_prefix ).
203
        LOOP AT lt_io INTO ls_io.
204
          CLEAR ls_mime.
205
          CALL FUNCTION 'SKWF_NMSPC_IO_ADDRESS_GET'
206
            EXPORTING
207
              io           = ls_io
208
            IMPORTING
209
              url          = l_url
210
              relative_url = l_rel_url
211
              error        = ls_error.
212
          IF ls_error IS INITIAL.
213
*           Shave off prefix of URL
214
            SHIFT l_url BY l_len PLACES.
215
            ls_mime-key = l_url.
216
            TRANSLATE ls_mime-key TO UPPER CASE.
217
            ls_mime-name = l_url.
218
            ls_mime-objtype = ls_io-objtype.
219
            ls_mime-class = ls_io-class.
220
            ls_mime-objid = ls_io-objid.
221
            l_filename = l_rel_url.
222
*           Get MIME type from filename
223
            CALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'
224
              EXPORTING
225
                filename = l_filename
226
              IMPORTING
227
                mimetype = ls_mime-mimetype.
228
*           Get MIME type description
229
            IF NOT ls_mime-mimetype IS INITIAL.
230
              CALL FUNCTION 'SKWF_MIMETYPE_DESCRIPTION_GET'
231
                EXPORTING
232
                  mimetype = ls_mime-mimetype
233
                  language = sy-langu
234
                IMPORTING
235
                  descript = ls_mime-mimetype_descript.
236
            ENDIF.
237
            IF NOT ls_mime IS INITIAL.
238
              APPEND ls_mime TO ct_mime.
239
            ENDIF.
240
          ENDIF.
241
        ENDLOOP.
242
      ENDIF.
243
    ENDIF.
244
  ENDIF.
245
  SORT ct_mime BY key.
246
ENDFORM.                    "get_mimes
247
 
248
 
249
*-----------------------------------------------------------------------
250
* o2_get_url
251
*-----------------------------------------------------------------------
252
FORM o2_get_url
253
  USING
254
    value(i_https) TYPE flag
255
    value(i_applname)                                       "char30
256
    value(i_pagekey)                                        "char70
257
    value(i_pagename)                                       "char70
258
    value(i_pagetype) TYPE c
259
    value(i_is_error_page) TYPE flag
260
  CHANGING
261
    c_url TYPE string.
262
 
263
  DATA:
264
  lo_page TYPE REF TO data.
265
 
266
  FIELD-SYMBOLS:
267
  <ls_page> TYPE ANY,
268
  <l_fs> TYPE ANY.
269
 
270
  CREATE DATA lo_page TYPE ('O2PAGENAME').
271
  ASSIGN lo_page->* TO <ls_page>.
272
 
273
  ASSIGN COMPONENT 'APPLNAME' OF STRUCTURE <ls_page> TO <l_fs>.
274
  <l_fs> = i_applname.
275
  ASSIGN COMPONENT 'PAGEKEY' OF STRUCTURE <ls_page> TO <l_fs>.
276
  <l_fs> = i_pagekey.
277
  ASSIGN COMPONENT 'PAGENAME' OF STRUCTURE <ls_page> TO <l_fs>.
278
  <l_fs> = i_pagename.
279
  ASSIGN COMPONENT 'PAGETYPE' OF STRUCTURE <ls_page> TO <l_fs>.
280
  <l_fs> = i_pagetype.
281
  ASSIGN COMPONENT 'IS_ERROR_PAGE' OF STRUCTURE <ls_page> TO <l_fs>.
282
  <l_fs> = i_is_error_page.
283
 
284
  CALL METHOD ('CL_O2_HELPER')=>generate_url_for_page
285
    EXPORTING
286
      p_page        = <ls_page>
287
      p_secure_http = i_https
288
    IMPORTING
289
      p_url         = c_url
290
    EXCEPTIONS
291
      OTHERS        = 1.
292
 
293
ENDFORM.                    "get_url
294
 
295
 
296
*-----------------------------------------------------------------------
297
* o2_r3tr_wapa                                  BSP Application
298
*-----------------------------------------------------------------------
299
FORM o2_r3tr_wapa.
300
 
301
  DATA:
302
  lt_tabstrip TYPE it_tabstrip,
303
  lt_html TYPE it_string,
304
  ls_attributes TYPE st_attributes,
305
  lo_appl TYPE REF TO data,
306
  lo_applt TYPE REF TO data,
307
  l_applname(30) TYPE c,
308
  l_applext(30) TYPE c,
309
  l_bname TYPE xubname,
310
  l_name_text TYPE ad_namtext,
311
  ls_o2navigation TYPE st_o2navigation,
312
  lt_o2navigation TYPE it_o2navigation,
313
  lo_navgraph TYPE REF TO data,
314
  l_pagekey(70) TYPE c,
315
  l_flag TYPE flag.
316
 
317
  FIELD-SYMBOLS:
318
  <ls_ztadir> TYPE st_ztadir,
319
  <ls_appl> TYPE ANY,
320
  <ls_applt> TYPE ANY,
321
  <l_fs> TYPE ANY,
322
  <ls_navgraph> TYPE ANY,
323
  <ls_tabstrip> TYPE st_tabstrip.
324
 
325
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
326
      WHERE pgmid = 'R3TR'
327
      AND object = 'WAPA'
328
      AND o2pagekey = space
329
      AND downloaded = abap_false.
330
    <ls_ztadir>-downloaded = abap_true.
331
 
332
    IF NOT <ls_navgraph> IS ASSIGNED.
333
      PERFORM get_tabstrip
334
      USING 'O2_R3TR_WAPA' space
335
      CHANGING lt_tabstrip.
336
 
337
      CREATE DATA lo_navgraph TYPE ('O2NAVGRAPH').
338
      ASSIGN lo_navgraph->* TO <ls_navgraph>.
339
 
340
      CREATE DATA lo_appl TYPE ('O2APPL').
341
      ASSIGN lo_appl->* TO <ls_appl>.
342
 
343
      CREATE DATA lo_applt TYPE ('O2APPLT').
344
      ASSIGN lo_applt->* TO <ls_applt>.
345
    ENDIF.
346
 
347
    REFRESH:
348
    lt_html,
349
    lt_o2navigation.
350
 
351
    CLEAR:
352
    ls_attributes,
353
    l_applname,
354
    l_applext,
355
    <ls_appl>,
356
    <ls_applt>.
357
 
358
*Properties
359
    l_applname = <ls_ztadir>-obj_name.
360
    SELECT SINGLE * FROM ('O2APPL') INTO <ls_appl>
361
        WHERE applname = l_applname
362
        AND version = 'A'.
363
    IF sy-subrc = 0.
364
      ASSIGN COMPONENT 'APPLEXT' OF STRUCTURE <ls_appl> TO <l_fs>.
365
      l_applext = <l_fs>.
366
 
367
      ls_attributes-space_after_descript = abap_true.
368
      ls_attributes-is_bsp_appl = abap_true.
369
 
370
      ls_attributes-descript = <ls_ztadir>-descript.
371
      ASSIGN COMPONENT 'AUTHOR' OF STRUCTURE <ls_appl> TO <l_fs>.
372
      ls_attributes-author = <l_fs>.
373
      l_bname = <l_fs>.
374
      PERFORM get_user
375
        USING l_bname
376
        CHANGING l_name_text.
377
      ls_attributes-author_text = l_name_text.
378
      ASSIGN COMPONENT 'CREATEDON' OF STRUCTURE <ls_appl> TO <l_fs>.
379
      PERFORM get_date
380
        USING <l_fs>
381
        CHANGING ls_attributes-date_created.
382
      ASSIGN COMPONENT 'CHANGEDBY' OF STRUCTURE <ls_appl> TO <l_fs>.
383
      ls_attributes-bname = <l_fs>.
384
      l_bname = <l_fs>.
385
      PERFORM get_user
386
        USING l_bname
387
        CHANGING l_name_text.
388
      ls_attributes-name_text = l_name_text.
389
      ASSIGN COMPONENT 'CHANGEDON' OF STRUCTURE <ls_appl> TO <l_fs>.
390
      PERFORM get_date
391
        USING <l_fs>
392
        CHANGING ls_attributes-date_last_changed.
393
      ls_attributes-devclass = <ls_ztadir>-devclass.
394
      PERFORM get_devclass
395
        USING <ls_ztadir>-devclass
396
        CHANGING ls_attributes-devclass_descr.
397
      PERFORM get_spras
398
        USING
399
          <ls_ztadir>-masterlang
400
        CHANGING
401
          ls_attributes-laiso
402
          ls_attributes-sptxt.
403
      ASSIGN COMPONENT 'APPLNAME' OF STRUCTURE <ls_appl> TO <l_fs>.
404
      ls_attributes-internal_name = <l_fs>.
405
      ASSIGN COMPONENT 'STARTPAGE' OF STRUCTURE <ls_appl> TO <l_fs>.
406
      ls_attributes-initial_bsp = <l_fs>.
407
      ASSIGN COMPONENT 'APPLCLAS' OF STRUCTURE <ls_appl> TO <l_fs>.
408
      ls_attributes-application_class = <l_fs>.
409
      ASSIGN COMPONENT 'THEME' OF STRUCTURE <ls_appl> TO <l_fs>.
410
      ls_attributes-initial_bsp = <l_fs>.
411
      ASSIGN COMPONENT 'STATEFUL' OF STRUCTURE <ls_appl> TO <l_fs>.
412
      ls_attributes-stateful = <l_fs>.
413
      ASSIGN COMPONENT 'SESSIONMANAGEMNT' OF STRUCTURE <ls_appl>
414
          TO <l_fs>.
415
      ls_attributes-supports_portal_integration = <l_fs>.
416
    ENDIF.
417
 
418
*Navigation
419
    SELECT * FROM ('O2NAVGRAPH') INTO <ls_navgraph>
420
        WHERE applname = l_applname
421
        AND version = 'A'.
422
      CLEAR ls_o2navigation.
423
* * * Navigation Request
424
      ASSIGN COMPONENT 'NODEEXIT' OF STRUCTURE <ls_navgraph>
425
          TO <l_fs>.
426
      ls_o2navigation-navrequest = <l_fs>.
427
* * * Start
428
      ASSIGN COMPONENT 'CURRNODE' OF STRUCTURE <ls_navgraph>
429
          TO <l_fs>.
430
      SELECT SINGLE pagekey FROM ('O2NAVMAP') INTO l_pagekey
431
          WHERE applname = l_applname
432
          AND version = 'A'
433
          AND node = <l_fs>.
434
      IF sy-subrc = 0.
435
        SELECT SINGLE pagename FROM ('O2PAGDIR')
436
            INTO ls_o2navigation-start
437
            WHERE applname = l_applname
438
            AND pagekey = l_pagekey.
439
      ENDIF.
440
* * * Target
441
      ASSIGN COMPONENT 'FUPNODE' OF STRUCTURE <ls_navgraph>
442
          TO <l_fs>.
443
      SELECT SINGLE pagekey FROM ('O2NAVMAP') INTO l_pagekey
444
          WHERE applname = l_applname
445
          AND version = 'A'
446
          AND node = <l_fs>.
447
      IF sy-subrc = 0.
448
        SELECT SINGLE pagename FROM ('O2PAGDIR')
449
            INTO ls_o2navigation-target
450
            WHERE applname = l_applname
451
            AND pagekey = l_pagekey.
452
      ENDIF.
453
* * *
454
      APPEND ls_o2navigation TO lt_o2navigation.
455
    ENDSELECT.
456
*** TabStrip
457
    LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
458
      <ls_tabstrip>-empty = abap_false.
459
      CASE <ls_tabstrip>-id.
460
        WHEN 'NAVIGATION'.
461
          IF lt_o2navigation IS INITIAL.
462
            <ls_tabstrip>-empty = abap_true.
463
          ENDIF.
464
      ENDCASE.
465
    ENDLOOP.
466
*HTML
467
    PERFORM html_main_header
468
      USING
469
        tpt_o2_wapa
470
        txt_bsp_application
471
        l_applext
472
        txt_active___1
473
        space
474
        space
475
        space
476
        lt_tabstrip
477
        gt_link
478
      CHANGING
479
        lt_html.
480
    l_flag = abap_false.
481
    IF lt_o2navigation IS INITIAL.
482
      l_flag = abap_true.
483
    ENDIF.
484
    PERFORM html_add_attributes_2
485
      USING
486
        ls_attributes
487
        'PROPERTIES'
488
        l_flag
489
      CHANGING
490
        lt_html.
491
    IF NOT lt_o2navigation IS INITIAL
492
    OR g_empty_tab = gc_empty_tab_display.
493
      PERFORM html_add_table
494
        USING
495
          'WAPA_NAVI'
496
          lt_o2navigation
497
          lt_o2navigation
498
          'NAVIGATION'
499
          abap_true
500
        CHANGING
501
          lt_html.
502
    ENDIF.
503
    PERFORM html_main_footer
504
      USING
505
        lt_html.
506
 
507
    PERFORM download
508
      USING
509
        lt_html
510
        <ls_ztadir>-pgmid
511
        <ls_ztadir>-object
512
        <ls_ztadir>-obj_name
513
        gc_extension_htm
514
        abap_true.
515
  ENDLOOP.
516
 
517
ENDFORM.                                                    "r3tr_wapa
518
 
519
 
520
*-----------------------------------------------------------------------
521
* o2_r3tr_wapa_appl                             BSP Applications
522
*-----------------------------------------------------------------------
523
FORM o2_r3tr_wapa_appl.
524
 
525
  DATA:
526
  mt_string TYPE it_string.
527
 
528
  TYPES:
529
  BEGIN OF st_o2pagevhs,
530
    applname(30) TYPE c,
531
    pagekey(70) TYPE c,
532
    evhandler(30) TYPE c,
533
    version TYPE c,
534
    evhname(30) TYPE c,
535
    source LIKE mt_string,
536
  END OF st_o2pagevhs,
537
  it_o2pagevhs TYPE SORTED TABLE OF st_o2pagevhs
538
    WITH UNIQUE KEY evhandler.
539
 
540
  DATA:
541
  lt_html TYPE it_string,
542
  l_objname(110) TYPE c,
543
  l_applname(30) TYPE c,
544
  l_pagekey(70) TYPE c,
545
  l_pagename(70) TYPE c,
546
  l_pagetype(1) TYPE c,
547
  l_is_error_page TYPE flag,
548
  l_https TYPE flag,
549
  lo_pagdir TYPE REF TO data,
550
  ls_ti TYPE st_textinput,
551
  ls_rb TYPE st_access,
552
  lt_prop_header TYPE it_textinput,
553
  lt_prop_page_type_rb TYPE it_access,
554
  lt_prop_page_type_ti TYPE it_textinput,
555
  lt_prop_error_handling TYPE it_textinput,
556
  lt_prop_status_rb TYPE it_access,
557
  lt_prop_status_ti TYPE it_textinput,
558
  lt_prop_caching_li TYPE it_textinput,
559
  lt_prop_caching_re TYPE it_textinput,
560
  lt_prop_transfer_options_li TYPE it_textinput,
561
  lt_prop_transfer_options_re TYPE it_textinput,
562
  lt_prop_footer TYPE it_textinput,
563
  lt_dom_value TYPE it_dom_value,
564
  l_bname TYPE xubname,
565
  l_name TYPE ad_namtext,
566
  lt_line TYPE it_line,
567
  lt_layout_src TYPE it_string,
568
  l_str TYPE string,
569
  lt_o2pagevhs TYPE it_o2pagevhs,
570
  lt_o2pagpars TYPE it_o2pagpars,
571
  lt_typesrc TYPE it_string,
572
  lt_used_guid TYPE it_guid,
573
  lt_tabstrip TYPE it_tabstrip,
574
  l_o2type TYPE c,
575
  l_type(4) TYPE c,
576
  l_filename TYPE string,
577
  l_filename2 TYPE string,
578
  lt_pageattr TYPE it_o2pageattr,
579
  ls_pageattr TYPE st_o2pageattr,
580
  l_flag TYPE flag,
581
  ls_tabstrip TYPE st_tabstrip,
582
  l_type_title TYPE string,
583
  l_title TYPE string,
584
  l_id TYPE string,
585
  l_javascript TYPE string.
586
 
587
  FIELD-SYMBOLS:
588
  <ls_ztadir> TYPE st_ztadir,
589
  <ls_pagdir> TYPE ANY,
590
  <ls_line> TYPE st_line,
591
  <l_fs> TYPE ANY,
592
  <ls_dom_value> TYPE st_dom_value,
593
  <ls_o2pagevhs> TYPE st_o2pagevhs,
594
  <ls_o2pagpars> TYPE st_o2pagpars,
595
  <ls_tabstrip> TYPE st_tabstrip.
596
 
597
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
598
      WHERE pgmid = 'R3TR'
599
      AND object = 'WAPA'
600
      AND o2pagekey <> space
601
      AND (
602
        o2type = gc_o2type_bsp
603
        OR o2type = gc_o2type_ctrl
604
        OR o2type = gc_o2type_incl
605
        OR o2type = gc_o2type_view
606
      )
607
      AND downloaded = abap_false.
608
    <ls_ztadir>-downloaded = abap_true.
609
 
610
    IF NOT <ls_pagdir> IS ASSIGNED.
611
      CREATE DATA lo_pagdir TYPE ('O2PAGATTR').
612
      ASSIGN lo_pagdir->* TO <ls_pagdir>.
613
    ENDIF.
614
 
615
    REFRESH:
616
    lt_html,
617
    lt_prop_header,
618
    lt_prop_page_type_rb,
619
    lt_prop_page_type_ti,
620
    lt_prop_error_handling,
621
    lt_prop_status_rb,
622
    lt_prop_status_ti,
623
    lt_prop_caching_li,
624
    lt_prop_caching_re,
625
    lt_prop_transfer_options_li,
626
    lt_prop_transfer_options_re,
627
    lt_prop_footer,
628
    lt_layout_src,
629
    lt_o2pagevhs,
630
    lt_o2pagpars,
631
    lt_typesrc,
632
    lt_used_guid,
633
    lt_tabstrip,
634
    lt_pageattr.
635
 
636
    CLEAR:
637
    l_objname,
638
    l_o2type,
639
    <ls_pagdir>,
640
    l_type,
641
    l_filename,
642
    l_filename2,
643
    l_flag,
644
    l_type_title,
645
    l_title,
646
    l_id,
647
    l_javascript.
648
 
649
    l_applname = <ls_ztadir>-obj_name.
650
    l_pagekey = <ls_ztadir>-o2pagekey.
651
    l_objname+0(30) = <ls_ztadir>-obj_name.
652
    l_objname+30(70) = <ls_ztadir>-o2pagekey.
653
 
654
    CALL FUNCTION 'O2_GET_WAPA_SOURCEN'
655
      EXPORTING
656
        p_objname       = l_objname
657
        p_versno        = 0
658
        p_devclass      = <ls_ztadir>-devclass
659
        p_langu         = sy-langu
660
        p_master_l      = sy-langu
661
      IMPORTING
662
        pt_page_content = lt_line
663
        pt_ev_handler   = lt_o2pagevhs
664
        pt_parameters   = lt_o2pagpars
665
        ps_page_attr    = <ls_pagdir>
666
        pt_typesource   = lt_typesrc
667
        pt_used_guids   = lt_used_guid
668
      EXCEPTIONS
669
        OTHERS          = 1.
670
 
671
    ASSIGN COMPONENT 'PAGENAME' OF STRUCTURE <ls_pagdir> TO <l_fs>.
672
    l_pagename = <l_fs>.
673
 
674
* Properties - Header
675
*   Description
676
    CLEAR ls_ti.
677
    ls_ti-name = txt_description.
678
    ls_ti-value = <ls_ztadir>-descript.
679
    ls_ti-input = abap_true.
680
    APPEND ls_ti TO lt_prop_header.
681
*
682
    IF <ls_ztadir>-o2type = gc_o2type_ctrl.
683
*     Controller Class
684
      CLEAR ls_ti.
685
      ls_ti-name = txt_controller_class.
686
      ASSIGN COMPONENT 'IMPLCLASS' OF STRUCTURE <ls_pagdir> TO <l_fs>.
687
      ls_ti-value = <l_fs>.
688
      ls_ti-input = abap_true.
689
      APPEND ls_ti TO lt_prop_header.
690
    ENDIF.
691
*
692
    IF <ls_ztadir>-o2type = gc_o2type_bsp
693
    OR <ls_ztadir>-o2type = gc_o2type_view.
694
*     Mime Type
695
      CLEAR ls_ti.
696
      ls_ti-name = txt_mime_type.
697
      ASSIGN COMPONENT 'MIMETYPE' OF STRUCTURE <ls_pagdir> TO <l_fs>.
698
      ls_ti-value = <l_fs>.
699
      IF ls_ti-value IS INITIAL.
700
        ls_ti-value = 'application/octet-stream'.
701
      ENDIF.
702
      ls_ti-input = abap_true.
703
      APPEND ls_ti TO lt_prop_header.
704
*     Compression
705
      CLEAR ls_ti.
706
      ls_ti-name = txt_compression.
707
      ASSIGN COMPONENT 'STRIPMODE' OF STRUCTURE <ls_pagdir>
708
          TO <l_fs>.
709
      PERFORM get_dom_value_text
710
        USING 'O2STRIPMODE' <l_fs>
711
        CHANGING ls_ti-value.
712
      ls_ti-input = abap_true.
713
      APPEND ls_ti TO lt_prop_header.
714
*     W/O Script Code
715
      CLEAR ls_ti.
716
      ls_ti-name = txt_wo_script_code.
717
      ASSIGN COMPONENT 'NO_SCRIPT' OF STRUCTURE <ls_pagdir> TO <l_fs>.
718
      ls_ti-value = <l_fs>.
719
      ls_ti-flag = abap_true.
720
      APPEND ls_ti TO lt_prop_header.
721
    ENDIF.
722
*
723
    IF <ls_ztadir>-o2type = gc_o2type_bsp
724
    OR <ls_ztadir>-o2type = gc_o2type_incl
725
    OR <ls_ztadir>-o2type = gc_o2type_view.
726
* Properties - Page Type
727
      ASSIGN COMPONENT 'PAGETYPE' OF STRUCTURE <ls_pagdir> TO <l_fs>.
728
      l_pagetype = <l_fs>.
729
*     View
730
      CLEAR ls_rb.
731
      ls_rb-ddtext = txt_view.
732
      IF l_pagetype = gc_o2type_view.
733
        ls_rb-checked = abap_true.
734
      ENDIF.
735
      APPEND ls_rb TO lt_prop_page_type_rb.
736
*     Page with Flow Logic
737
      CLEAR ls_rb.
738
      ls_rb-ddtext = txt_page_with_flow_logic.
739
      IF l_pagetype = gc_o2type_bsp.
740
        ls_rb-checked = abap_true.
741
      ENDIF.
742
      APPEND ls_rb TO lt_prop_page_type_rb.
743
*     Page Fragment
744
      CLEAR ls_rb.
745
      ls_rb-ddtext = txt_page_fragment.
746
      IF l_pagetype = gc_o2type_incl.
747
        ls_rb-checked = abap_true.
748
      ENDIF.
749
      APPEND ls_rb TO lt_prop_page_type_rb.
750
*     Controller class
751
      CLEAR ls_ti.
752
      ls_ti-name = txt_controller_class.
753
      ASSIGN COMPONENT 'CONTROLLERURL' OF STRUCTURE <ls_pagdir>
754
          TO <l_fs>.
755
      ls_ti-value = <l_fs>.
756
      ls_ti-input = abap_true.
757
      APPEND ls_ti TO lt_prop_page_type_ti.
758
    ENDIF.
759
*
760
    IF <ls_ztadir>-o2type = gc_o2type_bsp
761
    OR <ls_ztadir>-o2type = gc_o2type_ctrl
762
    OR <ls_ztadir>-o2type = gc_o2type_view.
763
* Properties - Error Handling
764
*     Is Error Page
765
      CLEAR ls_ti.
766
      ls_ti-name = txt_is_error_page.
767
      ASSIGN COMPONENT 'IS_ERROR_PAGE' OF STRUCTURE <ls_pagdir>
768
          TO <l_fs>.
769
      l_is_error_page = <l_fs>.
770
      ls_ti-value = l_is_error_page.
771
      ls_ti-flag = abap_true.
772
      APPEND ls_ti TO lt_prop_error_handling.
773
*     Assigned Error Page
774
      CLEAR ls_ti.
775
      ls_ti-name = txt_assigned_error_page.
776
      ASSIGN COMPONENT 'ERROR_PAGE' OF STRUCTURE <ls_pagdir>
777
          TO <l_fs>.
778
      ls_ti-value = <l_fs>.
779
      ls_ti-input = abap_true.
780
      APPEND ls_ti TO lt_prop_error_handling.
781
    ENDIF.
782
*
783
    IF <ls_ztadir>-o2type = gc_o2type_bsp
784
    OR <ls_ztadir>-o2type = gc_o2type_ctrl.
785
* Properties - Status
786
      PERFORM get_dom_value_texts
787
        USING 'O2PAGSTATE'
788
        CHANGING lt_dom_value.
789
      SORT lt_dom_value BY value.
790
      ASSIGN COMPONENT 'STATE' OF STRUCTURE <ls_pagdir> TO <l_fs>.
791
      LOOP AT lt_dom_value ASSIGNING <ls_dom_value>.
792
        CLEAR ls_rb.
793
        ls_rb-ddtext = <ls_dom_value>-text.
794
        IF <ls_dom_value>-value = <l_fs>.
795
          ls_rb-checked = abap_true.
796
        ENDIF.
797
        APPEND ls_rb TO lt_prop_status_rb.
798
      ENDLOOP.
799
*     Lifetime
800
      CLEAR ls_ti.
801
      ls_ti-name = txt_lifetime.
802
      ASSIGN COMPONENT 'LIFETIME' OF STRUCTURE <ls_pagdir> TO <l_fs>.
803
      PERFORM get_dom_value_text
804
        USING 'O2LIFETIME' <l_fs>
805
        CHANGING ls_ti-value.
806
      ls_ti-input = abap_true.
807
      APPEND ls_ti TO lt_prop_status_ti.
808
* Properties - Caching
809
*     Browser Cache
810
      CLEAR ls_ti.
811
      ls_ti-name = txt_browser_cache.
812
      ASSIGN COMPONENT 'BROWSER_CACHE' OF STRUCTURE <ls_pagdir>
813
          TO <l_fs>.
814
      ls_ti-value = <l_fs>.
815
      ls_ti-input = abap_true.
816
      ls_ti-description = txt_sec.
817
      APPEND ls_ti TO lt_prop_caching_li.
818
*     Server Cache
819
      CLEAR ls_ti.
820
      ls_ti-name = txt_server_cache.
821
      ASSIGN COMPONENT 'SERVER_CACHE' OF STRUCTURE <ls_pagdir>
822
          TO <l_fs>.
823
      ls_ti-value = <l_fs>.
824
      ls_ti-input = abap_true.
825
      ls_ti-description = txt_sec.
826
      APPEND ls_ti TO lt_prop_caching_li.
827
*
828
      CLEAR ls_ti.
829
      ls_ti-space = abap_true.
830
      APPEND ls_ti TO lt_prop_caching_re.
831
*     Browser-Specific
832
      CLEAR ls_ti.
833
      ls_ti-name = txt_browser_specific.
834
      ASSIGN COMPONENT 'BROWSER_DEP' OF STRUCTURE <ls_pagdir>
835
          TO <l_fs>.
836
      ls_ti-value = <l_fs>.
837
      ls_ti-flag = abap_true.
838
      APPEND ls_ti TO lt_prop_caching_re.
839
* Properties - Transfer Options
840
*     Compression
841
      CLEAR ls_ti.
842
      ls_ti-name = txt_compression.
843
      ASSIGN COMPONENT 'COMPRESSION' OF STRUCTURE <ls_pagdir>
844
          TO <l_fs>.
845
      ls_ti-value = <l_fs>.
846
      ls_ti-flag = abap_true.
847
      APPEND ls_ti TO lt_prop_transfer_options_li.
848
    ENDIF.
849
*
850
    IF <ls_ztadir>-o2type = gc_o2type_bsp
851
    OR <ls_ztadir>-o2type = gc_o2type_ctrl
852
    OR <ls_ztadir>-o2type = gc_o2type_view.
853
*     Delta Handling
854
      CLEAR ls_ti.
855
      ls_ti-name = txt_delta_handling.
856
      ASSIGN COMPONENT 'DELTA_HANDLING' OF STRUCTURE <ls_pagdir>
857
          TO <l_fs>.
858
      ls_ti-value = <l_fs>.
859
      ls_ti-flag = abap_true.
860
      APPEND ls_ti TO lt_prop_transfer_options_li.
861
    ENDIF.
862
*
863
    IF <ls_ztadir>-o2type = gc_o2type_bsp
864
    OR <ls_ztadir>-o2type = gc_o2type_ctrl.
865
*     HTTPS
866
      CLEAR ls_ti.
867
      ls_ti-name = txt_https.
868
      ASSIGN COMPONENT 'SECUREHTTP' OF STRUCTURE <ls_pagdir>
869
          TO <l_fs>.
870
      l_https = <l_fs>.
871
      ls_ti-value = l_https.
872
      ls_ti-flag = abap_true.
873
      APPEND ls_ti TO lt_prop_transfer_options_re.
874
    ENDIF.
875
* Properties - Footer
876
*   Created on
877
    CLEAR ls_ti.
878
    ls_ti-name = txt_created_on.
879
    ASSIGN COMPONENT 'AUTHOR' OF STRUCTURE <ls_pagdir> TO <l_fs>.
880
    l_bname = <l_fs>.
881
    PERFORM get_user
882
      USING l_bname
883
      CHANGING l_name.
884
    ls_ti-value = l_bname.
885
    ls_ti-value_text = l_name.
886
    ASSIGN COMPONENT 'CREATEDON' OF STRUCTURE <ls_pagdir> TO <l_fs>.
887
    PERFORM get_date
888
      USING <l_fs>
889
      CHANGING ls_ti-value_ext.
890
    ls_ti-input = abap_true.
891
    ls_ti-has_value_ext = abap_true.
892
    APPEND ls_ti TO lt_prop_footer.
893
*   Last Changed on
894
    CLEAR ls_ti.
895
    ls_ti-name = txt_last_changed_on.
896
    ASSIGN COMPONENT 'CHANGEDBY' OF STRUCTURE <ls_pagdir> TO <l_fs>.
897
    l_bname = <l_fs>.
898
    PERFORM get_user
899
      USING l_bname
900
      CHANGING l_name.
901
    ls_ti-value = l_bname.
902
    ls_ti-value_text = l_name.
903
    ASSIGN COMPONENT 'CHANGEDON' OF STRUCTURE <ls_pagdir> TO <l_fs>.
904
    PERFORM get_date
905
      USING <l_fs>
906
      CHANGING ls_ti-value_ext.
907
    ls_ti-input = abap_true.
908
    ls_ti-has_value_ext = abap_true.
909
    APPEND ls_ti TO lt_prop_footer.
910
*   Package
911
    CLEAR ls_ti.
912
    ls_ti-name = txt_package.
913
    ls_ti-value = <ls_ztadir>-devclass.
914
    ls_ti-input = abap_true.
915
    APPEND ls_ti TO lt_prop_footer.
916
*
917
    IF <ls_ztadir>-o2type = gc_o2type_bsp
918
    OR <ls_ztadir>-o2type = gc_o2type_ctrl.
919
*     URL
920
      CLEAR ls_ti.
921
      ls_ti-name = txt_url.
922
      PERFORM o2_get_url
923
        USING
924
          l_https
925
          l_applname
926
          l_pagekey
927
          l_pagename
928
          l_pagetype
929
          l_is_error_page
930
        CHANGING
931
          ls_ti-value.
932
      ls_ti-input = abap_true.
933
      APPEND ls_ti TO lt_prop_footer.
934
    ENDIF.
935
 
936
* Layout
937
    IF <ls_ztadir>-o2type = gc_o2type_bsp
938
    OR <ls_ztadir>-o2type = gc_o2type_incl
939
    OR <ls_ztadir>-o2type = gc_o2type_view.
940
      LOOP AT lt_line ASSIGNING <ls_line>.
941
        l_str = <ls_line>-line.
942
        APPEND l_str TO lt_layout_src.
943
      ENDLOOP.
944
    ENDIF.
945
 
946
* Page Attributes
947
    IF <ls_ztadir>-o2type = gc_o2type_bsp
948
    OR <ls_ztadir>-o2type = gc_o2type_view.
949
      LOOP AT lt_o2pagpars ASSIGNING <ls_o2pagpars>.
950
        CLEAR ls_pageattr.
951
        MOVE-CORRESPONDING <ls_o2pagpars> TO ls_pageattr.
952
        PERFORM get_dom_value_text
953
          USING
954
            'O2TYPTYPE'
955
            ls_pageattr-typtype
956
          CHANGING
957
            ls_pageattr-typtype_txt.
958
        IF ls_pageattr-pardecltyp = '0'.
959
          ls_pageattr-pardecltyp_flag = abap_true.
960
        ENDIF.
961
        APPEND ls_pageattr TO lt_pageattr.
962
      ENDLOOP.
963
    ENDIF.
964
 
965
    l_o2type = <ls_ztadir>-o2type.
966
    IF l_o2type IS INITIAL.
967
      l_o2type = 'B'.
968
    ENDIF.
969
    PERFORM get_tabstrip
970
      USING 'O2_R3TR_WAPA_APPL' l_o2type
971
      CHANGING lt_tabstrip.
972
    LOOP AT lt_tabstrip ASSIGNING <ls_tabstrip>.
973
      <ls_tabstrip>-empty = abap_false.
974
      CASE <ls_tabstrip>-id.
975
        WHEN 'LAYOUT'.
976
          IF lt_layout_src IS INITIAL.
977
            <ls_tabstrip>-empty = abap_true.
978
          ELSE.
979
            CONCATENATE l_javascript 'makeDivSize(''LAYOUT'');'
980
                INTO l_javascript.
981
          ENDIF.
982
        WHEN 'EVENT_HANDLER'.
983
          IF lt_o2pagevhs IS INITIAL.
984
            <ls_tabstrip>-empty = abap_true.
985
          ENDIF.
986
        WHEN 'PAGE_ATTRIBUTES'.
987
          IF lt_pageattr IS INITIAL.
988
            <ls_tabstrip>-empty = abap_true.
989
          ENDIF.
990
        WHEN 'TYPE_DEFINITIONS'.
991
          IF lt_typesrc IS INITIAL.
992
            <ls_tabstrip>-empty = abap_true.
993
          ELSE.
994
            CONCATENATE l_javascript
995
                'makeDivSize(''TYPE_DEFINITIONS'');'
996
                INTO l_javascript.
997
          ENDIF.
998
      ENDCASE.
999
    ENDLOOP.
1000
    LOOP AT lt_o2pagevhs ASSIGNING <ls_o2pagevhs>.
1001
      CLEAR ls_tabstrip.
1002
      ls_tabstrip-form = 'O2_R3TR_WAPA_APPL'.
1003
      ls_tabstrip-id = <ls_o2pagevhs>-evhandler.
1004
      ls_tabstrip-parent_id = 'EVENT_HANDLER'.
1005
      ls_tabstrip-text = <ls_o2pagevhs>-evhname.
1006
      IF sy-tabix = 1.
1007
        ls_tabstrip-active = abap_true.
1008
      ENDIF.
1009
      ls_tabstrip-tab_nr = sy-tabix + 20.
1010
      APPEND ls_tabstrip TO lt_tabstrip.
1011
      CONCATENATE l_javascript
1012
          'makeDivSize(''' <ls_o2pagevhs>-evhandler ''');'
1013
          INTO l_javascript.
1014
    ENDLOOP.
1015
 
1016
*Filename
1017
    CASE <ls_ztadir>-o2type.
1018
      WHEN gc_o2type_ctrl.
1019
        l_type = 'ctrl'.
1020
        l_title = tpt_o2_wapa_ctrl.
1021
        l_type_title = txt_controller.
1022
      WHEN gc_o2type_view.
1023
        l_type = 'view'.
1024
        l_title = tpt_o2_wapa_page.
1025
        l_type_title = txt_page.
1026
      WHEN gc_o2type_bsp.
1027
        l_type = 'bsp'.
1028
        l_title = tpt_o2_wapa_page.
1029
        l_type_title = txt_page.
1030
      WHEN gc_o2type_incl.
1031
        l_type = 'incl'.
1032
        l_title = tpt_o2_wapa_page.
1033
        l_type_title = txt_page.
1034
    ENDCASE.
1035
    PERFORM replace_single
1036
      USING '#NAME_VALUE#' <ls_ztadir>-obj_name
1037
      CHANGING l_title.
1038
    CONCATENATE <ls_ztadir>-obj_name '-' l_type
1039
        '/' <ls_ztadir>-o2pagename
1040
        INTO l_filename.
1041
 
1042
*HTML
1043
    PERFORM html_main_header
1044
      USING
1045
        l_title
1046
        l_type_title
1047
        <ls_ztadir>-o2pagename
1048
        txt_active___1
1049
        space
1050
        space
1051
        l_javascript
1052
        lt_tabstrip
1053
        gt_link
1054
      CHANGING
1055
        lt_html.
1056
*Properties
1057
    l_flag = abap_true.
1058
    IF <ls_ztadir>-o2type = gc_o2type_bsp
1059
    OR <ls_ztadir>-o2type = gc_o2type_incl
1060
    OR <ls_ztadir>-o2type = gc_o2type_view.
1061
      IF NOT lt_layout_src IS INITIAL
1062
      OR g_empty_tab = gc_empty_tab_display.
1063
        l_flag = abap_false.
1064
      ENDIF.
1065
    ENDIF.
1066
    PERFORM html_add_properties_o2
1067
      USING
1068
        lt_prop_header
1069
        txt_page_type
1070
        lt_prop_page_type_rb
1071
        lt_prop_page_type_ti
1072
        txt_error_handling
1073
        lt_prop_error_handling
1074
        txt_status
1075
        lt_prop_status_rb
1076
        lt_prop_status_ti
1077
        txt_caching
1078
        lt_prop_caching_li
1079
        lt_prop_caching_re
1080
        txt_transfer_options
1081
        lt_prop_transfer_options_li
1082
        lt_prop_transfer_options_re
1083
        lt_prop_footer
1084
        'PROPERTIES'
1085
        l_flag
1086
      CHANGING
1087
        lt_html.
1088
*Layout
1089
    IF <ls_ztadir>-o2type = gc_o2type_bsp
1090
    OR <ls_ztadir>-o2type = gc_o2type_incl
1091
    OR <ls_ztadir>-o2type = gc_o2type_view.
1092
      IF NOT lt_layout_src IS INITIAL
1093
      OR g_empty_tab = gc_empty_tab_display.
1094
        PERFORM html_add_sourcecode
1095
          USING
1096
            lt_layout_src
1097
            l_filename
1098
            space
1099
            space
1100
            gc_extension_txt
1101
            'LAYOUT'
1102
            abap_true
1103
          CHANGING
1104
            lt_html.
1105
        PERFORM download
1106
          USING
1107
            lt_layout_src
1108
            <ls_ztadir>-pgmid
1109
            <ls_ztadir>-object
1110
            l_filename
1111
            gc_extension_txt
1112
            abap_false.
1113
      ENDIF.
1114
    ENDIF.
1115
*Event Handler
1116
    IF <ls_ztadir>-o2type = gc_o2type_bsp.
1117
      IF NOT lt_o2pagevhs IS INITIAL
1118
      OR g_empty_tab = gc_empty_tab_display.
1119
        PERFORM html_add_container_begin
1120
          USING
1121
            lt_tabstrip
1122
            'EVENT_HANDLER'
1123
            abap_false
1124
          CHANGING
1125
            lt_html.
1126
*
1127
        LOOP AT lt_o2pagevhs ASSIGNING <ls_o2pagevhs>.
1128
          l_flag = abap_false.
1129
          IF sy-tabix = 1.
1130
            l_flag = abap_true.
1131
          ENDIF.
1132
          CONCATENATE l_filename '.' <ls_o2pagevhs>-evhandler
1133
              INTO l_filename2.
1134
          PERFORM html_add_sourcecode
1135
            USING
1136
              <ls_o2pagevhs>-source
1137
              l_filename2
1138
              space
1139
              space
1140
              gc_extension_txt
1141
              <ls_o2pagevhs>-evhandler
1142
              l_flag
1143
            CHANGING
1144
              lt_html.
1145
          PERFORM download
1146
            USING
1147
              <ls_o2pagevhs>-source
1148
              <ls_ztadir>-pgmid
1149
              <ls_ztadir>-object
1150
              l_filename2
1151
              gc_extension_txt
1152
              abap_false.
1153
        ENDLOOP.
1154
*
1155
        PERFORM html_add_container_end
1156
          CHANGING
1157
            lt_html.
1158
      ENDIF.
1159
    ENDIF.
1160
*Page Attributes
1161
    IF <ls_ztadir>-o2type = gc_o2type_bsp
1162
    OR <ls_ztadir>-o2type = gc_o2type_view.
1163
      IF NOT lt_pageattr IS INITIAL
1164
      OR g_empty_tab = gc_empty_tab_display.
1165
        PERFORM get_id
1166
          USING 'WAPA_ATTR|' l_o2type
1167
          CHANGING l_id.
1168
        PERFORM html_add_table
1169
          USING
1170
            l_id
1171
            lt_pageattr
1172
            lt_pageattr
1173
            'PAGE_ATTRIBUTES'
1174
            abap_false
1175
          CHANGING
1176
            lt_html.
1177
      ENDIF.
1178
    ENDIF.
1179
*Type Definitions
1180
    IF <ls_ztadir>-o2type = gc_o2type_bsp.
1181
      IF NOT lt_typesrc IS INITIAL
1182
      OR g_empty_tab = gc_empty_tab_display.
1183
        CONCATENATE l_filename '.types' INTO l_filename2.
1184
        PERFORM html_add_sourcecode
1185
          USING
1186
            lt_typesrc
1187
            l_filename2
1188
            space
1189
            space
1190
            gc_extension_txt
1191
            'TYPE_DEFINITIONS'
1192
            abap_false
1193
          CHANGING
1194
            lt_html.
1195
        PERFORM download
1196
          USING
1197
            lt_typesrc
1198
            <ls_ztadir>-pgmid
1199
            <ls_ztadir>-object
1200
            l_filename2
1201
            gc_extension_txt
1202
            abap_false.
1203
      ENDIF.
1204
    ENDIF.
1205
*
1206
    PERFORM html_main_footer
1207
      USING
1208
        lt_html.
1209
 
1210
    PERFORM download
1211
      USING
1212
        lt_html
1213
        <ls_ztadir>-pgmid
1214
        <ls_ztadir>-object
1215
        l_filename
1216
        gc_extension_htm
1217
        abap_true.
1218
  ENDLOOP.
1219
 
1220
ENDFORM.                    "r3tr_wapa_appl
1221
 
1222
 
1223
*-----------------------------------------------------------------------
1224
* o2_r3tr_wapa_mime                             Mimes
1225
*-----------------------------------------------------------------------
1226
FORM o2_r3tr_wapa_mime.
1227
 
1228
  DATA:
1229
  lt_content_ascii TYPE it_o2content_ascii,
1230
  lt_content_binary TYPE it_o2content_binary,
1231
  lt_ascii TYPE it_string,
1232
  ls_ascii TYPE string,
1233
  l_filename TYPE string,
1234
  l_filesize TYPE i.
1235
 
1236
  FIELD-SYMBOLS:
1237
  <ls_ztadir> TYPE st_ztadir,
1238
  <ls_content_ascii> TYPE st_o2content_ascii.
1239
 
1240
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
1241
      WHERE pgmid = 'R3TR'
1242
      AND object = 'WAPA'
1243
      AND o2pagekey <> space
1244
      AND o2type = gc_o2type_mime
1245
      AND downloaded = abap_false.
1246
    <ls_ztadir>-downloaded = abap_true.
1247
 
1248
    CLEAR:
1249
    l_filesize.
1250
 
1251
    REFRESH:
1252
    lt_content_ascii,
1253
    lt_content_binary,
1254
    lt_ascii.
1255
 
1256
    PERFORM o2_get_mime_content
1257
      USING
1258
        <ls_ztadir>-mime_objtype
1259
        <ls_ztadir>-mime_class
1260
        <ls_ztadir>-mime_objid
1261
      CHANGING
1262
        lt_content_ascii
1263
        lt_content_binary
1264
        l_filesize.
1265
 
1266
    CONCATENATE <ls_ztadir>-obj_name '-mime/'
1267
        <ls_ztadir>-o2pagename
1268
        INTO l_filename.
1269
 
1270
    IF NOT lt_content_ascii IS INITIAL.
1271
      LOOP AT lt_content_ascii ASSIGNING <ls_content_ascii>.
1272
        ls_ascii = <ls_content_ascii>-line.
1273
        APPEND ls_ascii TO lt_ascii.
1274
      ENDLOOP.
1275
 
1276
      PERFORM download
1277
        USING
1278
          lt_ascii
1279
          <ls_ztadir>-pgmid
1280
          <ls_ztadir>-object
1281
          l_filename
1282
          space
1283
          abap_true.
1284
    ENDIF.
1285
 
1286
    IF NOT lt_content_binary IS INITIAL.
1287
      PERFORM download_binary
1288
        USING
1289
          lt_content_binary
1290
          l_filesize
1291
          <ls_ztadir>-pgmid
1292
          <ls_ztadir>-object
1293
          l_filename
1294
          space
1295
          abap_true.
1296
    ENDIF.
1297
 
1298
  ENDLOOP.
1299
 
1300
ENDFORM.                    "r3tr_wapa_mime
1301
 
1302
 
1303
*-----------------------------------------------------------------------
1304
* o2_r3tr_wtag                                  BSP Extension
1305
*-----------------------------------------------------------------------
1306
FORM o2_r3tr_wtag.
1307
 
1308
  DATA:
1309
  lt_tabstrip TYPE it_tabstrip,
1310
  lt_html TYPE it_string,
1311
  ls_ti TYPE st_textinput,
1312
  lt_props TYPE it_textinput,
1313
  lt_general TYPE it_textinput,
1314
  lo_taglib TYPE REF TO data,
1315
  l_tlibid(30) TYPE c,
1316
  l_tlibname(30) TYPE c,
1317
  l_masterlang TYPE masterlang,
1318
  l_bname TYPE xubname,
1319
  l_name_text TYPE ad_namtext,
1320
  l_laiso TYPE laiso,
1321
  l_sptxt TYPE sptxt,
1322
  l_title TYPE string.
1323
 
1324
  FIELD-SYMBOLS:
1325
  <ls_ztadir> TYPE st_ztadir,
1326
  <ls_taglib> TYPE ANY,
1327
  <l_fs> TYPE ANY.
1328
 
1329
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
1330
      WHERE pgmid = 'R3TR'
1331
      AND object = 'WTAG'
1332
      AND o2pagekey = space
1333
      AND downloaded = abap_false.
1334
    <ls_ztadir>-downloaded = abap_true.
1335
 
1336
    IF NOT <ls_taglib> IS ASSIGNED.
1337
      PERFORM get_tabstrip
1338
        USING 'O2_R3TR_WTAG' space
1339
        CHANGING lt_tabstrip.
1340
 
1341
      CREATE DATA lo_taglib TYPE ('O2TAGLIB').
1342
      ASSIGN lo_taglib->* TO <ls_taglib>.
1343
    ENDIF.
1344
 
1345
    REFRESH:
1346
    lt_html,
1347
    lt_props,
1348
    lt_general.
1349
 
1350
    CLEAR <ls_taglib>.
1351
 
1352
    l_tlibid = <ls_ztadir>-obj_name.
1353
 
1354
    SELECT SINGLE masterlang FROM tadir INTO l_masterlang
1355
        WHERE pgmid = 'R3TR'
1356
        AND object = 'WTAG'
1357
        AND obj_name = <ls_ztadir>-obj_name.
1358
 
1359
    SELECT SINGLE * FROM ('O2TAGLIB') INTO <ls_taglib>
1360
        WHERE tlibid = l_tlibid
1361
        AND state = 'A'.
1362
 
1363
    ASSIGN COMPONENT 'TLIBNAME' OF STRUCTURE <ls_taglib> TO <l_fs>.
1364
    l_tlibname = <l_fs>.
1365
 
1366
*Properties
1367
*   Short Description
1368
    CLEAR ls_ti.
1369
    ls_ti-name = txt_short_description___2.
1370
    ls_ti-value = <ls_ztadir>-descript.
1371
    ls_ti-input = abap_true.
1372
    APPEND ls_ti TO lt_props.
1373
*   Default Prefix
1374
    CLEAR ls_ti.
1375
    ls_ti-name = txt_default_prefix.
1376
    ASSIGN COMPONENT 'PREFIX' OF STRUCTURE <ls_taglib> TO <l_fs>.
1377
    ls_ti-value = <l_fs>.
1378
    ls_ti-value_ext_space = abap_true.
1379
    ls_ti-input = abap_true.
1380
    ls_ti-has_value_ext = abap_true.
1381
    APPEND ls_ti TO lt_props.
1382
*   BSP Extension Class
1383
    CLEAR ls_ti.
1384
    ls_ti-name = txt_bsp_extension_class.
1385
    ASSIGN COMPONENT 'TAGLIBCLASS' OF STRUCTURE <ls_taglib> TO <l_fs>.
1386
    ls_ti-value = <l_fs>.
1387
    ls_ti-value_ext_space = abap_true.
1388
    ls_ti-input = abap_true.
1389
    ls_ti-has_value_ext = abap_true.
1390
    APPEND ls_ti TO lt_props.
1391
*   BSP Element Basis Class
1392
    CLEAR ls_ti.
1393
    ls_ti-name = txt_bsp_element_basis_class.
1394
    ASSIGN COMPONENT 'TAGBASECLASS' OF STRUCTURE <ls_taglib>
1395
        TO <l_fs>.
1396
    ls_ti-value = <l_fs>.
1397
    ls_ti-value_ext_space = abap_true.
1398
    ls_ti-input = abap_true.
1399
    ls_ti-has_value_ext = abap_true.
1400
    APPEND ls_ti TO lt_props.
1401
*General Data
1402
*   Created by
1403
    CLEAR ls_ti.
1404
    ls_ti-name = txt_created_by___1.
1405
    ASSIGN COMPONENT 'AUTHOR' OF STRUCTURE <ls_taglib> TO <l_fs>.
1406
    ls_ti-value = <l_fs>.
1407
    l_bname = <l_fs>.
1408
    PERFORM get_user
1409
      USING l_bname
1410
      CHANGING l_name_text.
1411
    ls_ti-value_text = l_name_text.
1412
    ls_ti-value_ext_space = abap_true.
1413
    ls_ti-input = abap_true.
1414
    ls_ti-has_value_ext = abap_true.
1415
    APPEND ls_ti TO lt_general.
1416
*   Creation Date
1417
    CLEAR ls_ti.
1418
    ls_ti-name = txt_creation_date.
1419
    ASSIGN COMPONENT 'CREATEDON' OF STRUCTURE <ls_taglib> TO <l_fs>.
1420
    PERFORM get_date
1421
      USING
1422
        <l_fs>
1423
      CHANGING
1424
        ls_ti-value.
1425
    ls_ti-value_ext_space = abap_true.
1426
    ls_ti-input = abap_true.
1427
    ls_ti-has_value_ext = abap_true.
1428
    APPEND ls_ti TO lt_general.
1429
*   Last Changed
1430
    CLEAR ls_ti.
1431
    ls_ti-name = txt_last_changed.
1432
    ASSIGN COMPONENT 'CHANGEDBY' OF STRUCTURE <ls_taglib> TO <l_fs>.
1433
    ls_ti-value = <l_fs>.
1434
    l_bname = <l_fs>.
1435
    PERFORM get_user
1436
      USING l_bname
1437
      CHANGING l_name_text.
1438
    ls_ti-value_text = l_name_text.
1439
    ls_ti-value_ext_space = abap_true.
1440
    ls_ti-input = abap_true.
1441
    ls_ti-has_value_ext = abap_true.
1442
    APPEND ls_ti TO lt_general.
1443
*   Changed On
1444
    CLEAR ls_ti.
1445
    ls_ti-name = txt_changed_on.
1446
    ASSIGN COMPONENT 'CHANGEDON' OF STRUCTURE <ls_taglib> TO <l_fs>.
1447
    PERFORM get_date
1448
      USING
1449
        <l_fs>
1450
      CHANGING
1451
        ls_ti-value.
1452
    ls_ti-value_ext_space = abap_true.
1453
    ls_ti-input = abap_true.
1454
    ls_ti-has_value_ext = abap_true.
1455
    APPEND ls_ti TO lt_general.
1456
*   Time changed
1457
    CLEAR ls_ti.
1458
    ls_ti-name = txt_time_changed.
1459
    ASSIGN COMPONENT 'STAMP' OF STRUCTURE <ls_taglib> TO <l_fs>.
1460
    PERFORM get_time
1461
      USING
1462
        <l_fs>
1463
      CHANGING
1464
        ls_ti-value.
1465
    ls_ti-value_ext_space = abap_true.
1466
    ls_ti-input = abap_true.
1467
    ls_ti-has_value_ext = abap_true.
1468
    APPEND ls_ti TO lt_general.
1469
*   Package
1470
    CLEAR ls_ti.
1471
    ls_ti-name = txt_package.
1472
    ls_ti-value = <ls_ztadir>-devclass.
1473
    ls_ti-input = abap_true.
1474
    APPEND ls_ti TO lt_general.
1475
*   Original Language
1476
    CLEAR ls_ti.
1477
    ls_ti-name = txt_original_language.
1478
    PERFORM get_spras
1479
      USING l_masterlang
1480
      CHANGING l_laiso l_sptxt.
1481
    ls_ti-value = l_laiso.
1482
    ls_ti-value_text = l_sptxt.
1483
    ls_ti-value_ext_space = abap_true.
1484
    ls_ti-input = abap_true.
1485
    ls_ti-has_value_ext = abap_true.
1486
    APPEND ls_ti TO lt_general.
1487
*Title
1488
    l_title = tpt_o2_wtag.
1489
    PERFORM replace_single
1490
      USING
1491
        var_name_value
1492
        <ls_ztadir>-obj_name
1493
      CHANGING
1494
        l_title.
1495
*HTML
1496
    PERFORM html_main_header
1497
      USING
1498
        l_title
1499
        txt_bsp_extension
1500
        l_tlibname
1501
        txt_active___1
1502
        space
1503
        space
1504
        space
1505
        lt_tabstrip
1506
        gt_link
1507
      CHANGING
1508
        lt_html.
1509
*Properties
1510
    PERFORM html_add_textinput_subbox
1511
      USING
1512
        lt_props
1513
        txt_general_data
1514
        lt_general
1515
        'PROPERTIES'
1516
        abap_true
1517
      CHANGING
1518
        lt_html.
1519
*
1520
    PERFORM html_main_footer
1521
      USING
1522
        lt_html.
1523
 
1524
    PERFORM download
1525
      USING
1526
        lt_html
1527
        <ls_ztadir>-pgmid
1528
        <ls_ztadir>-object
1529
        <ls_ztadir>-obj_name
1530
        gc_extension_htm
1531
        abap_true.
1532
  ENDLOOP.
1533
 
1534
ENDFORM.                                                    "r3tr_wtag
1535
 
1536
 
1537
*-----------------------------------------------------------------------
1538
* o2_r3tr_wtag_ext                              BSP Extensions
1539
*-----------------------------------------------------------------------
1540
FORM o2_r3tr_wtag_ext.
1541
 
1542
  DATA:
1543
  lt_tabstrip TYPE it_tabstrip,
1544
  lt_html TYPE it_string,
1545
  ls_ti TYPE st_textinput,
1546
  lt_props TYPE it_textinput,
1547
  lt_general TYPE it_textinput,
1548
  lt_options TYPE it_textinput,
1549
  ls_rb TYPE st_access,
1550
  lt_content TYPE it_access,
1551
  lo_tag TYPE REF TO data,
1552
  lo_att TYPE REF TO data,
1553
  ls_att TYPE st_o2tagatt,
1554
  lt_att TYPE it_o2tagatt,
1555
  l_tlibid(30) TYPE c,
1556
  l_tagid(30) TYPE c,
1557
  l_masterlang TYPE masterlang,
1558
  l_bname TYPE xubname,
1559
  l_name_text TYPE ad_namtext,
1560
  l_laiso TYPE laiso,
1561
  l_sptxt TYPE sptxt,
1562
  l_title TYPE string,
1563
  l_filename TYPE string.
1564
 
1565
  FIELD-SYMBOLS:
1566
  <ls_ztadir> TYPE st_ztadir,
1567
  <ls_tag> TYPE ANY,
1568
  <ls_att> TYPE ANY,
1569
  <l_fs> TYPE ANY.
1570
 
1571
  CONSTANTS:
1572
  lc_content_empty      TYPE c VALUE 'E',
1573
  lc_content_inner_tags TYPE c VALUE 'I',
1574
  lc_content_bsp        TYPE c VALUE 'B',
1575
  lc_content_tagdep     TYPE c VALUE 'T'.
1576
 
1577
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
1578
      WHERE pgmid = 'R3TR'
1579
      AND object = 'WTAG'
1580
      AND o2pagekey <> space
1581
      AND downloaded = abap_false.
1582
    <ls_ztadir>-downloaded = abap_true.
1583
 
1584
    IF NOT <ls_tag> IS ASSIGNED.
1585
      PERFORM get_tabstrip
1586
        USING 'O2_R3TR_WTAG_EXT' space
1587
        CHANGING lt_tabstrip.
1588
 
1589
      CREATE DATA lo_tag TYPE ('O2TAG').
1590
      ASSIGN lo_tag->* TO <ls_tag>.
1591
 
1592
      CREATE DATA lo_att TYPE ('O2TAGATT').
1593
      ASSIGN lo_att->* TO <ls_att>.
1594
    ENDIF.
1595
 
1596
    REFRESH:
1597
    lt_html,
1598
    lt_props,
1599
    lt_general,
1600
    lt_content,
1601
    lt_options,
1602
    lt_att.
1603
 
1604
    CLEAR:
1605
    <ls_tag>,
1606
    <ls_att>,
1607
    ls_rb,
1608
    ls_att,
1609
    l_filename.
1610
 
1611
    l_tlibid = <ls_ztadir>-obj_name.
1612
    l_tagid = <ls_ztadir>-o2name.
1613
 
1614
    SELECT SINGLE * FROM ('O2TAG') INTO <ls_tag>
1615
        WHERE tlibid = l_tlibid
1616
        AND tagid = l_tagid
1617
        AND state = 'A'.
1618
 
1619
*Properties
1620
*   Short Description
1621
    CLEAR ls_ti.
1622
    ls_ti-name = txt_short_description___2.
1623
    ls_ti-value = <ls_ztadir>-descript.
1624
    ls_ti-input = abap_true.
1625
    APPEND ls_ti TO lt_props.
1626
*   Element Handler Class
1627
    CLEAR ls_ti.
1628
    ls_ti-name = txt_element_handler_class.
1629
    ASSIGN COMPONENT 'TAGCLASS' OF STRUCTURE <ls_tag> TO <l_fs>.
1630
    ls_ti-value = <l_fs>.
1631
    ls_ti-value_ext_space = abap_true.
1632
    ls_ti-input = abap_true.
1633
    ls_ti-has_value_ext = abap_true.
1634
    APPEND ls_ti TO lt_props.
1635
*   BSP Extension Class
1636
    CLEAR ls_ti.
1637
    ls_ti-name = txt_bsp_extension_class.
1638
    ASSIGN COMPONENT 'GENCLASS' OF STRUCTURE <ls_tag> TO <l_fs>.
1639
    ls_ti-value = <l_fs>.
1640
    ls_ti-value_ext_space = abap_true.
1641
    ls_ti-input = abap_true.
1642
    ls_ti-has_value_ext = abap_true.
1643
    APPEND ls_ti TO lt_props.
1644
*Element: content
1645
    ASSIGN COMPONENT 'BCONTENT' OF STRUCTURE <ls_tag> TO <l_fs>.
1646
*   Blank
1647
    CLEAR ls_rb.
1648
    ls_rb-ddtext = txt_blank.
1649
    IF <l_fs> = lc_content_empty.
1650
      ls_rb-checked = abap_true.
1651
    ENDIF.
1652
    APPEND ls_rb TO lt_content.
1653
*   BSP Elements Only
1654
    CLEAR ls_rb.
1655
    ls_rb-ddtext = txt_bsp_elements_only.
1656
    IF <l_fs> = lc_content_inner_tags.
1657
      ls_rb-checked = abap_true.
1658
    ENDIF.
1659
    APPEND ls_rb TO lt_content.
1660
*   BSP Elements and Static HTML
1661
    CLEAR ls_rb.
1662
    ls_rb-ddtext = txt_bsp_elements_and_static_ht.
1663
    IF <l_fs> = lc_content_bsp.
1664
      ls_rb-checked = abap_true.
1665
    ENDIF.
1666
    APPEND ls_rb TO lt_content.
1667
*   Element Interprets Content Itself
1668
    CLEAR ls_rb.
1669
    ls_rb-ddtext = txt_element_interprets_content.
1670
    IF <l_fs> = lc_content_tagdep.
1671
      ls_rb-checked = abap_true.
1672
    ENDIF.
1673
    APPEND ls_rb TO lt_content.
1674
*Further options
1675
*   User-Defined Validation
1676
    CLEAR ls_ti.
1677
    ls_ti-name = txt_user_defined_validation.
1678
    ASSIGN COMPONENT 'VALIDATION' OF STRUCTURE <ls_tag> TO <l_fs>.
1679
    ls_ti-value = <l_fs>.
1680
    ls_ti-flag = abap_true.
1681
    APPEND ls_ti TO lt_options.
1682
*   Iteration over Element Content
1683
    CLEAR ls_ti.
1684
    ls_ti-name = txt_iteration_over_element_con.
1685
    ASSIGN COMPONENT 'ITERATION' OF STRUCTURE <ls_tag> TO <l_fs>.
1686
    ls_ti-value = <l_fs>.
1687
    ls_ti-flag = abap_true.
1688
    APPEND ls_ti TO lt_options.
1689
*   Manipulation of Element Content
1690
    CLEAR ls_ti.
1691
    ls_ti-name = txt_manipulation_of_element_co.
1692
    ASSIGN COMPONENT 'BODYWRITER' OF STRUCTURE <ls_tag> TO <l_fs>.
1693
    ls_ti-value = <l_fs>.
1694
    ls_ti-flag = abap_true.
1695
    APPEND ls_ti TO lt_options.
1696
*   "PAGE DONE" is not returned at end of BSP element
1697
    CLEAR ls_ti.
1698
    ls_ti-name = txt_page_done_is_not_returned_.
1699
    ASSIGN COMPONENT 'NOPAGEDONE' OF STRUCTURE <ls_tag> TO <l_fs>.
1700
    ls_ti-value = <l_fs>.
1701
    ls_ti-flag = abap_true.
1702
    APPEND ls_ti TO lt_options.
1703
*General Data
1704
*   Created by
1705
    CLEAR ls_ti.
1706
    ls_ti-name = txt_created_by___1.
1707
    ASSIGN COMPONENT 'AUTHOR' OF STRUCTURE <ls_tag> TO <l_fs>.
1708
    ls_ti-value = <l_fs>.
1709
    l_bname = <l_fs>.
1710
    PERFORM get_user
1711
      USING l_bname
1712
      CHANGING l_name_text.
1713
    ls_ti-value_text = l_name_text.
1714
    ls_ti-value_ext_space = abap_true.
1715
    ls_ti-input = abap_true.
1716
    ls_ti-has_value_ext = abap_true.
1717
    APPEND ls_ti TO lt_general.
1718
*   Creation Date
1719
    CLEAR ls_ti.
1720
    ls_ti-name = txt_creation_date.
1721
    ASSIGN COMPONENT 'CREATEDON' OF STRUCTURE <ls_tag> TO <l_fs>.
1722
    PERFORM get_date
1723
      USING
1724
        <l_fs>
1725
      CHANGING
1726
        ls_ti-value.
1727
    ls_ti-value_ext_space = abap_true.
1728
    ls_ti-input = abap_true.
1729
    ls_ti-has_value_ext = abap_true.
1730
    APPEND ls_ti TO lt_general.
1731
*   Last Changed
1732
    CLEAR ls_ti.
1733
    ls_ti-name = txt_last_changed.
1734
    ASSIGN COMPONENT 'CHANGEDBY' OF STRUCTURE <ls_tag> TO <l_fs>.
1735
    ls_ti-value = <l_fs>.
1736
    l_bname = <l_fs>.
1737
    PERFORM get_user
1738
      USING l_bname
1739
      CHANGING l_name_text.
1740
    ls_ti-value_text = l_name_text.
1741
    ls_ti-value_ext_space = abap_true.
1742
    ls_ti-input = abap_true.
1743
    ls_ti-has_value_ext = abap_true.
1744
    APPEND ls_ti TO lt_general.
1745
*   Changed On
1746
    CLEAR ls_ti.
1747
    ls_ti-name = txt_changed_on.
1748
    ASSIGN COMPONENT 'CHANGEDON' OF STRUCTURE <ls_tag> TO <l_fs>.
1749
    PERFORM get_date
1750
      USING
1751
        <l_fs>
1752
      CHANGING
1753
        ls_ti-value.
1754
    ls_ti-value_ext_space = abap_true.
1755
    ls_ti-input = abap_true.
1756
    ls_ti-has_value_ext = abap_true.
1757
    APPEND ls_ti TO lt_general.
1758
*Attribute
1759
    SELECT * FROM ('O2TAGATT') INTO <ls_att>
1760
        WHERE tlibid = l_tlibid
1761
        AND state = 'A'
1762
        AND tagid = l_tagid.
1763
      ASSIGN COMPONENT 'ATTID' OF STRUCTURE <ls_att> TO <l_fs>.
1764
      ls_att-attid = <l_fs>.
1765
      ASSIGN COMPONENT 'REQUIRED' OF STRUCTURE <ls_att> TO <l_fs>.
1766
      ls_att-required = <l_fs>.
1767
      ASSIGN COMPONENT 'RTEXPR' OF STRUCTURE <ls_att> TO <l_fs>.
1768
      ls_att-rtexpr = <l_fs>.
1769
      ASSIGN COMPONENT 'BYREF' OF STRUCTURE <ls_att> TO <l_fs>.
1770
      ls_att-byref = <l_fs>.
1771
      ASSIGN COMPONENT 'TYPE' OF STRUCTURE <ls_att> TO <l_fs>.
1772
      ls_att-type = <l_fs>.
1773
      ASSIGN COMPONENT 'DEFVAL' OF STRUCTURE <ls_att> TO <l_fs>.
1774
      ls_att-defval = <l_fs>.
1775
      ASSIGN COMPONENT 'BINDABLE' OF STRUCTURE <ls_att> TO <l_fs>.
1776
      ls_att-bindable = <l_fs>.
1777
      ASSIGN COMPONENT 'TYPTYPE' OF STRUCTURE <ls_att> TO <l_fs>.
1778
      PERFORM get_dom_value_text
1779
        USING
1780
          'O2TYPTYPE'
1781
          <l_fs>
1782
        CHANGING
1783
          ls_att-typtype_txt.
1784
      SELECT SINGLE descript FROM ('TAGATTT') INTO ls_att-descript
1785
          WHERE tlibid = l_tlibid
1786
          AND state = 'A'
1787
          AND langu = sy-langu
1788
          AND tagid = l_tagid
1789
          AND attid = ls_att-attid.
1790
      APPEND ls_att TO lt_att.
1791
    ENDSELECT.
1792
*Title
1793
    l_title = tpt_o2_wtag.
1794
    PERFORM replace_single
1795
      USING
1796
        var_name_value
1797
        <ls_ztadir>-obj_name
1798
      CHANGING
1799
        l_title.
1800
*HTML
1801
    PERFORM html_main_header
1802
      USING
1803
        l_title
1804
        txt_bsp_element
1805
        l_tagid
1806
        txt_active___1
1807
        space
1808
        space
1809
        space
1810
        lt_tabstrip
1811
        gt_link
1812
      CHANGING
1813
        lt_html.
1814
*   Properties
1815
    PERFORM html_add_textinput_subboxes
1816
      USING
1817
        lt_props
1818
        txt_element_content
1819
        'ec'
1820
        lt_content
1821
        txt_further_options
1822
        lt_options
1823
        txt_general_data
1824
        lt_general
1825
        'PROPERTIES'
1826
        abap_true
1827
      CHANGING
1828
        lt_html.
1829
*   Attribute
1830
    PERFORM html_add_table
1831
      USING
1832
        'WTAG_ATTR'
1833
        lt_att
1834
        lt_att
1835
        'ATTRIBUTE'
1836
        abap_false
1837
      CHANGING
1838
        lt_html.
1839
*
1840
    PERFORM html_main_footer
1841
      USING
1842
        lt_html.
1843
 
1844
    CONCATENATE <ls_ztadir>-obj_name '-' l_tagid INTO l_filename.
1845
    PERFORM download
1846
      USING
1847
        lt_html
1848
        <ls_ztadir>-pgmid
1849
        <ls_ztadir>-object
1850
        l_filename
1851
        gc_extension_htm
1852
        abap_true.
1853
  ENDLOOP.
1854
 
1855
ENDFORM.                    "r3tr_wtag_ext
1856
 
1857
 
1858
*-----------------------------------------------------------------------
1859
* o2_r3tr_xslt                                  Transformations
1860
*-----------------------------------------------------------------------
1861
FORM o2_r3tr_xslt.
1862
 
1863
  DATA:
1864
  lt_html TYPE it_string,
1865
  lt_tabstrip TYPE it_tabstrip,
1866
  l_name(40) TYPE c,
1867
  ls_attributes TYPE st_attributes,
1868
  l_author TYPE xubname,
1869
  l_createdon TYPE dats,
1870
  l_changedon TYPE dats,
1871
  l_bname TYPE xubname,
1872
  l_xslt_id(43) TYPE c,
1873
  l_xslt_name TYPE progname.
1874
 
1875
  FIELD-SYMBOLS:
1876
  <ls_ztadir> TYPE st_ztadir,
1877
  <ls_xslt_source> TYPE st_o2pageline.
1878
 
1879
 
1880
 
1881
  LOOP AT gt_ztadir ASSIGNING <ls_ztadir>
1882
      WHERE pgmid = 'R3TR'
1883
      AND object = 'XSLT'
1884
      AND downloaded = abap_false.
1885
    <ls_ztadir>-downloaded = abap_true.
1886
 
1887
    IF lt_tabstrip IS INITIAL.
1888
      PERFORM get_tabstrip
1889
        USING 'O2_R3TR_XSLT' space
1890
        CHANGING lt_tabstrip.
1891
    ENDIF.
1892
 
1893
    CLEAR:
1894
    ls_attributes,
1895
    l_xslt_name.
1896
 
1897
    REFRESH:
1898
    lt_html.
1899
 
1900
    l_name = <ls_ztadir>-obj_name.
1901
*Attributes
1902
    SELECT SINGLE author createdon changedon changedby
1903
      FROM ('O2XSLTDESC')
1904
      INTO (ls_attributes-author, l_createdon,
1905
        l_changedon, ls_attributes-bname)
1906
      WHERE xsltdesc = l_name
1907
      AND state = 'A'
1908
      AND srtf2 = 0.
1909
 
1910
    l_author = ls_attributes-author.
1911
    PERFORM get_user
1912
      USING l_author
1913
      CHANGING ls_attributes-author_text.
1914
    PERFORM get_date
1915
      USING l_createdon
1916
      CHANGING ls_attributes-date_created.
1917
    PERFORM get_date
1918
      USING l_changedon
1919
      CHANGING ls_attributes-date_last_changed.
1920
    l_bname = ls_attributes-bname.
1921
    PERFORM get_user
1922
        USING l_bname
1923
        CHANGING ls_attributes-name_text.
1924
 
1925
    ls_attributes-descript = <ls_ztadir>-descript.
1926
    ls_attributes-devclass = <ls_ztadir>-devclass.
1927
    PERFORM get_devclass
1928
      USING ls_attributes-devclass
1929
      CHANGING ls_attributes-devclass_descr.
1930
 
1931
    PERFORM get_spras
1932
      USING <ls_ztadir>-masterlang
1933
      CHANGING ls_attributes-laiso ls_attributes-sptxt.
1934
*Source
1935
    PERFORM get_trdir_name
1936
      USING l_name 'XT'
1937
      CHANGING l_xslt_name.
1938
*HTML
1939
    PERFORM html_main_header
1940
      USING
1941
        tpt_o2_xslt
1942
        txt_transformation
1943
        <ls_ztadir>-obj_name
1944
        txt_active___1
1945
        space
1946
        space
1947
        'makeDivSize(''SOURCECODE'')'
1948
        lt_tabstrip
1949
        gt_link
1950
      CHANGING
1951
        lt_html.
1952
    PERFORM html_add_attributes_2
1953
      USING
1954
        ls_attributes
1955
        'ATTRIBUTES'
1956
        abap_false
1957
      CHANGING
1958
        lt_html.
1959
    PERFORM add_report_sourcecode
1960
      USING
1961
        l_xslt_name
1962
        l_name
1963
        gc_extension_xsl
1964
        abap_false
1965
        <ls_ztadir>
1966
        'SOURCECODE'
1967
        abap_true
1968
      CHANGING
1969
        lt_html.
1970
*
1971
    PERFORM html_main_footer
1972
      USING
1973
        lt_html.
1974
 
1975
    PERFORM download
1976
      USING
1977
        lt_html
1978
        <ls_ztadir>-pgmid
1979
        <ls_ztadir>-object
1980
        <ls_ztadir>-obj_name
1981
        gc_extension_htm
1982
        abap_true.
1983
  ENDLOOP.
1984
 
1985
ENDFORM.                                                    "r3tr_xslt