METHOD add_alternativeformatpart.
CASE iv_content_type.
WHEN cl_docx_alternativeformatpart=>co_content_type_text.
WHEN cl_docx_alternativeformatpart=>co_content_type_rtf.
WHEN cl_docx_alternativeformatpart=>co_content_type_html.
WHEN cl_docx_alternativeformatpart=>co_content_type_word.
WHEN cl_docx_alternativeformatpart=>co_content_type_wordt.
WHEN OTHERS.
RAISE EXCEPTION TYPE cx_openxml_not_allowed.
ENDCASE.
rr_part ?= package->delegate_add_1_to_n_part( ir_parturi = me->parturi
iv_content_type = iv_content_type ).
ENDMETHOD.
DEFINE add_1_to_n_af_relation.
add_allowed_rel( iv_content_type_from = &1=>co_content_type
iv_content_type_to = &2=>co_content_type_text
iv_relation_type = &2=>co_relation_type ).
add_allowed_rel( iv_content_type_from = &1=>co_content_type
iv_content_type_to = &2=>co_content_type_rtf
iv_relation_type = &2=>co_relation_type ).
add_allowed_rel( iv_content_type_from = &1=>co_content_type
iv_content_type_to = &2=>co_content_type_html
iv_relation_type = &2=>co_relation_type ).
* Added part
add_allowed_rel( iv_content_type_from = &1=>co_content_type
iv_content_type_to = &2=>co_content_type_word
iv_relation_type = &2=>co_relation_type ).
add_allowed_rel( iv_content_type_from = &1=>co_content_type
iv_content_type_to = &2=>co_content_type_wordt
iv_relation_type = &2=>co_relation_type ).
END-OF-DEFINITION.
* add_partclass cl_docx_maindocumentpart. "comment out
add_partclass zcl_docx_maindocumentpart. "added part
add_partclass_m cl_docx_maindocumentpart macro.
add_partclass_m cl_docx_maindocumentpart template.
add_partclass_m cl_docx_maindocumentpart macrotemplate.
add_partclass_a cl_docx_alternativeformatpart text.
add_partclass_a cl_docx_alternativeformatpart rtf.
add_partclass_a cl_docx_alternativeformatpart html.
* Added part
add_partclass_a cl_docx_alternativeformatpart word.
add_partclass_a cl_docx_alternativeformatpart wordt.
PRIVATE SECTION.
DATA part_handling_map_table_ext TYPE HASHED TABLE OF ty_part_handling_map WITH UNIQUE KEY content_type class_name.
METHOD add_part_handling.
CALL METHOD super->add_part_handling
EXPORTING
iv_content_type = iv_content_type
iv_class_name = iv_class_name
iv_filepath = iv_filepath
iv_filename = iv_filename
iv_fileext = iv_fileext
iv_numbered_path = iv_numbered_path
iv_numbered_file = iv_numbered_file
iv_guid_name = iv_guid_name
iv_default_type = iv_default_type.
IF ( iv_content_type EQ me->co_content_type_word OR
iv_content_type EQ me->co_content_type_wordt ) AND
iv_class_name EQ me->co_class_word.
DATA: lph TYPE ty_part_handling_map.
CLEAR lph.
lph-content_type = me->normalize_content_type( iv_content_type ).
lph-class_name = iv_class_name.
lph-filepath = iv_filepath.
lph-filename = iv_filename.
lph-fileext = iv_fileext.
lph-guid_name = iv_guid_name.
lph-numbered_path = iv_numbered_path.
lph-numbered_file = iv_numbered_file.
lph-default_type = iv_default_type.
INSERT lph INTO TABLE part_handling_map_table_ext.
ENDIF.
ENDMETHOD.
METHOD get_part_handling.
IF iv_relation_type EQ zcl_docx_document=>co_relation_type_afchunk AND
( iv_content_type EQ cl_docx_alternativeformatpart=>co_content_type_word OR
iv_content_type EQ cl_docx_alternativeformatpart=>co_content_type_wordt ).
READ TABLE part_handling_map_table_ext WITH TABLE KEY content_type = iv_content_type class_name = zcl_openxml_package=>co_class_word INTO rs_part_hndl.
ELSE.
CALL METHOD super->get_part_handling
EXPORTING
iv_content_type = iv_content_type
iv_relation_type = iv_relation_type
RECEIVING
rs_part_hndl = rs_part_hndl.
ENDIF.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |