diff --git a/apps/adl_workbench/src/gui/export/export_dialog.e b/apps/adl_workbench/src/gui/export/export_dialog.e index cd76d96f7..165cd85d1 100755 --- a/apps/adl_workbench/src/gui/export/export_dialog.e +++ b/apps/adl_workbench/src/gui/export/export_dialog.e @@ -110,6 +110,11 @@ feature {NONE} -- Initialization evx_input_frame.extend (evx_type_marking_cb.ev_data_control, True) gui_controls.extend (evx_type_marking_cb) + -- output templates as OPTs (not just flat templates): check box + create evx_tpls_as_opts_cb.make_linked (get_text ({ADL_MESSAGES_IDS}.ec_tpls_as_opts_cb_text), get_text ({ADL_MESSAGES_IDS}.ec_tpls_as_opts_cb_tooltip), + agent :BOOLEAN do Result := export_tpls_as_opts end, agent set_export_tpls_as_opts) + evx_input_frame.extend (evx_tpls_as_opts_cb.ev_data_control, True) + gui_controls.extend (evx_tpls_as_opts_cb) -- compile all first: check box evx_input_frame.add_row (False) @@ -360,7 +365,10 @@ feature {NONE} -- Implementation else execution_state := es_ready_to_generate end + + -- output all archetypes and flattened source templates archetype_exporter.setup_build ([output_directory, evx_format_cob.data_control_text, export_flat, evx_flatten_with_rm_cb.is_selected, False]) + archetype_exporter.setup_build ([output_directory, evx_format_cob.data_control_text, export_flat, evx_flatten_with_rm_cb.is_selected, export_tpls_as_opts]) -- start compilation elseif execution_state = es_ready_to_compile then @@ -442,7 +450,7 @@ feature {NONE} -- Implementation gui_controls: ARRAYED_LIST [EVX_DATA_CONTROL] - evx_compile_first_cb, evx_flatten_with_rm_cb, evx_type_marking_cb: EVX_CHECK_BOX_CONTROL + evx_compile_first_cb, evx_flatten_with_rm_cb, evx_type_marking_cb, evx_tpls_as_opts_cb: EVX_CHECK_BOX_CONTROL evx_dir_setter: EVX_DIRECTORY_SETTER diff --git a/apps/resources/messages/compiled/adl_messages_db.e b/apps/resources/messages/compiled/adl_messages_db.e index c8f7add75..cffdfeeb4 100755 --- a/apps/resources/messages/compiled/adl_messages_db.e +++ b/apps/resources/messages/compiled/adl_messages_db.e @@ -24,7 +24,7 @@ feature -- Initialisation make do - create message_table.make (985) + create message_table.make (987) message_table.put ("Terminology initialisation failed; reason: $1", ec_terminology_init_failed) message_table.put ("Using ADL version $1 for output serialisation", ec_adl_version_warning) message_table.put ("Validation level STRICT", ec_validation_strict) @@ -975,6 +975,8 @@ feature -- Initialisation message_table.put ("Include RM in flattening process, causing RM existence and cardinality to be included and occurrences to be generated", ec_flatten_with_rm_cb_tooltip) message_table.put ("Type marking", ec_type_marking_cb_text) message_table.put ("Add type marking to object formats, i.e. JSON, YAML, ODIN", ec_type_marking_cb_tooltip) + message_table.put ("Export OPTs only", ec_tpls_as_opts_cb_text) + message_table.put ("Export only OPTs", ec_tpls_as_opts_cb_tooltip) message_table.put ("Save instance to file", ec_save_instance_dialog_title) message_table.put ("Save $1 file", ec_save_instance_to_file_title) message_table.put ("Original text", ec_translation_original_label_text) diff --git a/apps/resources/messages/compiled/adl_messages_ids.e b/apps/resources/messages/compiled/adl_messages_ids.e index c47773564..2ce057c21 100755 --- a/apps/resources/messages/compiled/adl_messages_ids.e +++ b/apps/resources/messages/compiled/adl_messages_ids.e @@ -960,6 +960,8 @@ feature -- Definitions ec_flatten_with_rm_cb_tooltip: STRING = "flatten_with_rm_cb_tooltip" ec_type_marking_cb_text: STRING = "type_marking_cb_text" ec_type_marking_cb_tooltip: STRING = "type_marking_cb_tooltip" + ec_tpls_as_opts_cb_text: STRING = "tpls_as_opts_cb_text" + ec_tpls_as_opts_cb_tooltip: STRING = "tpls_as_opts_cb_tooltip" ec_save_instance_dialog_title: STRING = "save_instance_dialog_title" ec_save_instance_to_file_title: STRING = "save_instance_to_file_title" ec_translation_original_label_text: STRING = "translation_original_label_text" diff --git a/apps/resources/messages/source/app_awb_ui_messages.txt b/apps/resources/messages/source/app_awb_ui_messages.txt index 36b0a7de4..7a6ae8043 100755 --- a/apps/resources/messages/source/app_awb_ui_messages.txt +++ b/apps/resources/messages/source/app_awb_ui_messages.txt @@ -795,6 +795,9 @@ templates = < ["type_marking_cb_text"] = <"Type marking"> ["type_marking_cb_tooltip"] = <"Add type marking to object formats, i.e. JSON, YAML, ODIN"> + ["tpls_as_opts_cb_text"] = <"Export OPTs only"> + ["tpls_as_opts_cb_tooltip"] = <"Export only OPTs"> + -- GUI_INSTANCE_CONTROL ["save_instance_dialog_title"] = <"Save instance to file"> ["save_instance_to_file_title"] = <"Save $1 file"> diff --git a/components/app_shell/shared_adl_app_resources.e b/components/app_shell/shared_adl_app_resources.e index 1c1daddb8..c282ee511 100644 --- a/components/app_shell/shared_adl_app_resources.e +++ b/components/app_shell/shared_adl_app_resources.e @@ -152,6 +152,11 @@ feature -- Definitions create Result.make_from_string ("/compiler/type_marking") end + Compiler_export_tpls_as_opts_resource_path: IMMUTABLE_STRING_8 + once + create Result.make_from_string ("/compiler/export_tpls_as_opts") + end + File_system_aom_profile_user_directory_resource_path: IMMUTABLE_STRING_8 once create Result.make_from_string ("/file_system/aom_profile_user_directory") @@ -452,6 +457,18 @@ feature -- Application Switches app_cfg.put_boolean_value (Compiler_type_marking_resource_path, flag) end + export_tpls_as_opts: BOOLEAN + -- output templates as OPTs? + do + Result := app_cfg.boolean_value (Compiler_export_tpls_as_opts_resource_path) + end + + set_export_tpls_as_opts (flag: BOOLEAN) + -- Set flag to output templates as OPTs rather than flattened source templates + do + app_cfg.put_boolean_value (Compiler_export_tpls_as_opts_resource_path, flag) + end + aom_profile_directory: STRING -- Path of directory where AOM profiles are found - note: this should be writable. do