dcc 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +3 -0
- data/.rubocop.yml +16 -0
- data/.rubocop_todo.yml +10 -0
- data/CHANGELOG.adoc +54 -0
- data/CONTRIBUTING.adoc +64 -0
- data/Gemfile +25 -0
- data/LICENSE +21 -0
- data/README.adoc +69 -0
- data/Rakefile +13 -0
- data/dcc.gemspec +41 -0
- data/docs/cli-reference.adoc +67 -0
- data/docs/getting-started.adoc +117 -0
- data/docs/schema-versions.adoc +65 -0
- data/examples/build_minimal_dcc.rb +23 -0
- data/examples/convert_all_formats.rb +19 -0
- data/examples/parse_and_inspect.rb +19 -0
- data/examples/quantity_math_demo.rb +32 -0
- data/examples/validate_full.rb +27 -0
- data/exe/dcc +7 -0
- data/lib/dcc/base/administrative_data.rb +43 -0
- data/lib/dcc/base/byte_data.rb +36 -0
- data/lib/dcc/base/calibration_laboratory.rb +29 -0
- data/lib/dcc/base/comment.rb +23 -0
- data/lib/dcc/base/condition.rb +34 -0
- data/lib/dcc/base/contact.rb +38 -0
- data/lib/dcc/base/contact_not_strict.rb +38 -0
- data/lib/dcc/base/core_data.rb +44 -0
- data/lib/dcc/base/data.rb +42 -0
- data/lib/dcc/base/digital_calibration_certificate.rb +32 -0
- data/lib/dcc/base/equipment_class.rb +24 -0
- data/lib/dcc/base/formula.rb +33 -0
- data/lib/dcc/base/hash_type.rb +34 -0
- data/lib/dcc/base/identification.rb +27 -0
- data/lib/dcc/base/identifications.rb +27 -0
- data/lib/dcc/base/influence_condition.rb +16 -0
- data/lib/dcc/base/influence_condition_list.rb +40 -0
- data/lib/dcc/base/item.rb +38 -0
- data/lib/dcc/base/item_list.rb +38 -0
- data/lib/dcc/base/list.rb +44 -0
- data/lib/dcc/base/location.rb +36 -0
- data/lib/dcc/base/measurement_meta_data.rb +15 -0
- data/lib/dcc/base/measurement_meta_data_list.rb +27 -0
- data/lib/dcc/base/measurement_result.rb +41 -0
- data/lib/dcc/base/measurement_result_list.rb +28 -0
- data/lib/dcc/base/measuring_equipment.rb +41 -0
- data/lib/dcc/base/measuring_equipment_list.rb +38 -0
- data/lib/dcc/base/quantity.rb +61 -0
- data/lib/dcc/base/ref_type_definition.rb +36 -0
- data/lib/dcc/base/ref_type_definition_list.rb +21 -0
- data/lib/dcc/base/resp_person.rb +38 -0
- data/lib/dcc/base/resp_person_list.rb +27 -0
- data/lib/dcc/base/result.rb +31 -0
- data/lib/dcc/base/result_list.rb +27 -0
- data/lib/dcc/base/rich_content.rb +34 -0
- data/lib/dcc/base/software.rb +35 -0
- data/lib/dcc/base/software_list.rb +27 -0
- data/lib/dcc/base/statement.rb +50 -0
- data/lib/dcc/base/statement_list.rb +27 -0
- data/lib/dcc/base/string_with_lang.rb +24 -0
- data/lib/dcc/base/text.rb +33 -0
- data/lib/dcc/base/used_method.rb +31 -0
- data/lib/dcc/base/used_method_list.rb +27 -0
- data/lib/dcc/base/xml_blob.rb +20 -0
- data/lib/dcc/base.rb +58 -0
- data/lib/dcc/builder/dsl.rb +10 -0
- data/lib/dcc/builder/session.rb +170 -0
- data/lib/dcc/builder.rb +34 -0
- data/lib/dcc/cli/cli.rb +149 -0
- data/lib/dcc/cli/formatters.rb +77 -0
- data/lib/dcc/cli.rb +7 -0
- data/lib/dcc/common_elements.rb +20 -0
- data/lib/dcc/context_configuration.rb +167 -0
- data/lib/dcc/context_options.rb +47 -0
- data/lib/dcc/convert/csv.rb +129 -0
- data/lib/dcc/convert/html.rb +127 -0
- data/lib/dcc/convert/json.rb +62 -0
- data/lib/dcc/convert/result.rb +51 -0
- data/lib/dcc/convert/yaml.rb +21 -0
- data/lib/dcc/convert.rb +14 -0
- data/lib/dcc/diff/change.rb +21 -0
- data/lib/dcc/diff/result.rb +58 -0
- data/lib/dcc/diff.rb +83 -0
- data/lib/dcc/error.rb +54 -0
- data/lib/dcc/extract/file.rb +143 -0
- data/lib/dcc/extract/ring.rb +28 -0
- data/lib/dcc/extract.rb +9 -0
- data/lib/dcc/i18n/text_lookup.rb +67 -0
- data/lib/dcc/i18n.rb +12 -0
- data/lib/dcc/inspect/report.rb +139 -0
- data/lib/dcc/inspect.rb +9 -0
- data/lib/dcc/migrate.rb +41 -0
- data/lib/dcc/namespace/dcc.rb +30 -0
- data/lib/dcc/namespace/dsig.rb +15 -0
- data/lib/dcc/namespace/math_ml.rb +14 -0
- data/lib/dcc/namespace/qudt.rb +15 -0
- data/lib/dcc/namespace/si.rb +26 -0
- data/lib/dcc/namespace.rb +18 -0
- data/lib/dcc/plugin/registry.rb +45 -0
- data/lib/dcc/plugin.rb +42 -0
- data/lib/dcc/quantity_format/formatter.rb +90 -0
- data/lib/dcc/quantity_format.rb +10 -0
- data/lib/dcc/quantity_math/quantity.rb +46 -0
- data/lib/dcc/quantity_math/real.rb +116 -0
- data/lib/dcc/quantity_math.rb +14 -0
- data/lib/dcc/schema/resources/dcc/dsi/v1.0.1.xsd +415 -0
- data/lib/dcc/schema/resources/dcc/dsi/v1.3.0.xsd +814 -0
- data/lib/dcc/schema/resources/dcc/dsi/v1.3.1.xsd +814 -0
- data/lib/dcc/schema/resources/dcc/dsi/v2.0.0.xsd +869 -0
- data/lib/dcc/schema/resources/dcc/dsi/v2.1.0.xsd +1031 -0
- data/lib/dcc/schema/resources/dcc/dsi/v2.2.1.xsd +1574 -0
- data/lib/dcc/schema/resources/dcc/qudt/v2.2.1.xsd +44 -0
- data/lib/dcc/schema/resources/dcc/v2.1.0/dcc.xsd +650 -0
- data/lib/dcc/schema/resources/dcc/v2.1.1/dcc.xsd +669 -0
- data/lib/dcc/schema/resources/dcc/v2.2.0/dcc.xsd +730 -0
- data/lib/dcc/schema/resources/dcc/v2.3.0/dcc.xsd +708 -0
- data/lib/dcc/schema/resources/dcc/v2.4.0/dcc.xsd +725 -0
- data/lib/dcc/schema/resources/dcc/v3.0.0/dcc.xsd +749 -0
- data/lib/dcc/schema/resources/dcc/v3.1.0/dcc.xsd +843 -0
- data/lib/dcc/schema/resources/dcc/v3.1.1/dcc.xsd +843 -0
- data/lib/dcc/schema/resources/dcc/v3.1.2/dcc.xsd +844 -0
- data/lib/dcc/schema/resources/dcc/v3.2.0/dcc.xsd +940 -0
- data/lib/dcc/schema/resources/dcc/v3.2.1/dcc.xsd +963 -0
- data/lib/dcc/schema/resources/dcc/v3.3.0/dcc.xsd +1008 -0
- data/lib/dcc/schema/resources/dcc/xmldsig-core-schema.xsd +312 -0
- data/lib/dcc/schema/resources/dsi/qudt/v2.2.1.xsd +44 -0
- data/lib/dcc/schema/resources/dsi/v1.0.1/SI_Format.xsd +415 -0
- data/lib/dcc/schema/resources/dsi/v1.3.0/SI_Format.xsd +814 -0
- data/lib/dcc/schema/resources/dsi/v1.3.1/SI_Format.xsd +814 -0
- data/lib/dcc/schema/resources/dsi/v2.0.0/SI_Format.xsd +869 -0
- data/lib/dcc/schema/resources/dsi/v2.1.0/SI_Format.xsd +1031 -0
- data/lib/dcc/schema/resources/dsi/v2.2.1/SI_Format.xsd +1574 -0
- data/lib/dcc/schema/resources/qudt/qudt.xsd +44 -0
- data/lib/dcc/schema/resources/schematron/dcc.sch +523 -0
- data/lib/dcc/schema/resources/schematron/dcc.svrl +2302 -0
- data/lib/dcc/schema/resources/xmldsig/xmldsig-core-schema.xsd +312 -0
- data/lib/dcc/schema/version.rb +94 -0
- data/lib/dcc/schema.rb +35 -0
- data/lib/dcc/server/app.rb +133 -0
- data/lib/dcc/server/storage/entry.rb +15 -0
- data/lib/dcc/server/storage/memory.rb +57 -0
- data/lib/dcc/server/storage.rb +13 -0
- data/lib/dcc/server.rb +33 -0
- data/lib/dcc/si/base/complex.rb +43 -0
- data/lib/dcc/si/base/complex_list_xml_list.rb +39 -0
- data/lib/dcc/si/base/constant.rb +39 -0
- data/lib/dcc/si/base/coverage_interval_mu.rb +31 -0
- data/lib/dcc/si/base/expanded_mu.rb +29 -0
- data/lib/dcc/si/base/expanded_unc_xml_list.rb +30 -0
- data/lib/dcc/si/base/hybrid.rb +42 -0
- data/lib/dcc/si/base/measurement_uncertainty_univariate.rb +28 -0
- data/lib/dcc/si/base/real.rb +48 -0
- data/lib/dcc/si/base/real_list_xml_list.rb +45 -0
- data/lib/dcc/si/base/si_list.rb +37 -0
- data/lib/dcc/si/base/standard_mu.rb +25 -0
- data/lib/dcc/si/base.rb +24 -0
- data/lib/dcc/si/common_elements.rb +13 -0
- data/lib/dcc/si/namespace.rb +7 -0
- data/lib/dcc/si/v1/common_elements.rb +13 -0
- data/lib/dcc/si/v1/complex.rb +8 -0
- data/lib/dcc/si/v1/complex_list_xml_list.rb +8 -0
- data/lib/dcc/si/v1/configuration.rb +13 -0
- data/lib/dcc/si/v1/constant.rb +8 -0
- data/lib/dcc/si/v1/coverage_interval_mu.rb +8 -0
- data/lib/dcc/si/v1/expanded_mu.rb +8 -0
- data/lib/dcc/si/v1/expanded_unc.rb +23 -0
- data/lib/dcc/si/v1/expanded_unc_xml_list.rb +8 -0
- data/lib/dcc/si/v1/hybrid.rb +8 -0
- data/lib/dcc/si/v1/measurement_uncertainty_univariate.rb +8 -0
- data/lib/dcc/si/v1/namespace.rb +9 -0
- data/lib/dcc/si/v1/real.rb +8 -0
- data/lib/dcc/si/v1/real_list_xml_list.rb +8 -0
- data/lib/dcc/si/v1/si_list.rb +8 -0
- data/lib/dcc/si/v1/standard_mu.rb +8 -0
- data/lib/dcc/si/v1.rb +46 -0
- data/lib/dcc/si/v2/common_elements.rb +13 -0
- data/lib/dcc/si/v2/complex.rb +8 -0
- data/lib/dcc/si/v2/complex_list_xml_list.rb +8 -0
- data/lib/dcc/si/v2/configuration.rb +13 -0
- data/lib/dcc/si/v2/constant.rb +8 -0
- data/lib/dcc/si/v2/coverage_interval_mu.rb +8 -0
- data/lib/dcc/si/v2/coverage_interval_mu_xml_list.rb +24 -0
- data/lib/dcc/si/v2/expanded_mu.rb +8 -0
- data/lib/dcc/si/v2/expanded_mu_xml_list.rb +22 -0
- data/lib/dcc/si/v2/expanded_unc_xml_list.rb +8 -0
- data/lib/dcc/si/v2/hybrid.rb +8 -0
- data/lib/dcc/si/v2/measurement_uncertainty_univariate.rb +8 -0
- data/lib/dcc/si/v2/namespace.rb +9 -0
- data/lib/dcc/si/v2/real.rb +8 -0
- data/lib/dcc/si/v2/real_list_xml_list.rb +8 -0
- data/lib/dcc/si/v2/si_list.rb +8 -0
- data/lib/dcc/si/v2/standard_mu.rb +8 -0
- data/lib/dcc/si/v2/standard_mu_xml_list.rb +18 -0
- data/lib/dcc/si/v2.rb +49 -0
- data/lib/dcc/si.rb +34 -0
- data/lib/dcc/signature/result.rb +43 -0
- data/lib/dcc/signature/signer.rb +36 -0
- data/lib/dcc/signature/verifier.rb +41 -0
- data/lib/dcc/signature.rb +13 -0
- data/lib/dcc/transform/result.rb +24 -0
- data/lib/dcc/transform/xslt.rb +72 -0
- data/lib/dcc/transform.rb +12 -0
- data/lib/dcc/type/base64_binary.rb +55 -0
- data/lib/dcc/type/decimal_xml_list.rb +47 -0
- data/lib/dcc/type/iso_country_code.rb +23 -0
- data/lib/dcc/type/iso_language_code.rb +23 -0
- data/lib/dcc/type/schema_version.rb +37 -0
- data/lib/dcc/type/si_unit.rb +26 -0
- data/lib/dcc/type.rb +16 -0
- data/lib/dcc/type_guards.rb +140 -0
- data/lib/dcc/v2/administrative_data.rb +8 -0
- data/lib/dcc/v2/byte_data.rb +8 -0
- data/lib/dcc/v2/calibration_laboratory.rb +8 -0
- data/lib/dcc/v2/comment.rb +8 -0
- data/lib/dcc/v2/common_elements.rb +13 -0
- data/lib/dcc/v2/condition.rb +8 -0
- data/lib/dcc/v2/configuration.rb +17 -0
- data/lib/dcc/v2/contact.rb +8 -0
- data/lib/dcc/v2/contact_not_strict.rb +8 -0
- data/lib/dcc/v2/core_data.rb +8 -0
- data/lib/dcc/v2/data.rb +8 -0
- data/lib/dcc/v2/digital_calibration_certificate.rb +8 -0
- data/lib/dcc/v2/equipment_class.rb +8 -0
- data/lib/dcc/v2/formula.rb +8 -0
- data/lib/dcc/v2/hash_type.rb +8 -0
- data/lib/dcc/v2/identification.rb +8 -0
- data/lib/dcc/v2/identifications.rb +8 -0
- data/lib/dcc/v2/influence_condition.rb +7 -0
- data/lib/dcc/v2/influence_condition_list.rb +8 -0
- data/lib/dcc/v2/item.rb +8 -0
- data/lib/dcc/v2/item_list.rb +8 -0
- data/lib/dcc/v2/list.rb +8 -0
- data/lib/dcc/v2/location.rb +8 -0
- data/lib/dcc/v2/measurement_meta_data.rb +8 -0
- data/lib/dcc/v2/measurement_meta_data_list.rb +8 -0
- data/lib/dcc/v2/measurement_result.rb +8 -0
- data/lib/dcc/v2/measurement_result_list.rb +8 -0
- data/lib/dcc/v2/measuring_equipment.rb +8 -0
- data/lib/dcc/v2/measuring_equipment_list.rb +8 -0
- data/lib/dcc/v2/namespace.rb +8 -0
- data/lib/dcc/v2/quantity.rb +49 -0
- data/lib/dcc/v2/ref_type_definition.rb +11 -0
- data/lib/dcc/v2/ref_type_definition_list.rb +15 -0
- data/lib/dcc/v2/resp_person.rb +8 -0
- data/lib/dcc/v2/resp_person_list.rb +8 -0
- data/lib/dcc/v2/result.rb +8 -0
- data/lib/dcc/v2/result_list.rb +8 -0
- data/lib/dcc/v2/rich_content.rb +12 -0
- data/lib/dcc/v2/software.rb +8 -0
- data/lib/dcc/v2/software_list.rb +8 -0
- data/lib/dcc/v2/statement.rb +8 -0
- data/lib/dcc/v2/statement_list.rb +8 -0
- data/lib/dcc/v2/string_with_lang.rb +8 -0
- data/lib/dcc/v2/text.rb +8 -0
- data/lib/dcc/v2/used_method.rb +8 -0
- data/lib/dcc/v2/used_method_list.rb +8 -0
- data/lib/dcc/v2/xml_blob.rb +8 -0
- data/lib/dcc/v2.rb +84 -0
- data/lib/dcc/v3/administrative_data.rb +8 -0
- data/lib/dcc/v3/byte_data.rb +8 -0
- data/lib/dcc/v3/calibration_laboratory.rb +8 -0
- data/lib/dcc/v3/comment.rb +8 -0
- data/lib/dcc/v3/common_elements.rb +11 -0
- data/lib/dcc/v3/condition.rb +8 -0
- data/lib/dcc/v3/configuration.rb +17 -0
- data/lib/dcc/v3/contact.rb +8 -0
- data/lib/dcc/v3/contact_not_strict.rb +8 -0
- data/lib/dcc/v3/core_data.rb +8 -0
- data/lib/dcc/v3/data.rb +8 -0
- data/lib/dcc/v3/digital_calibration_certificate.rb +8 -0
- data/lib/dcc/v3/equipment_class.rb +8 -0
- data/lib/dcc/v3/formula.rb +8 -0
- data/lib/dcc/v3/hash_type.rb +8 -0
- data/lib/dcc/v3/identification.rb +8 -0
- data/lib/dcc/v3/identifications.rb +8 -0
- data/lib/dcc/v3/influence_condition.rb +7 -0
- data/lib/dcc/v3/influence_condition_list.rb +8 -0
- data/lib/dcc/v3/item.rb +8 -0
- data/lib/dcc/v3/item_list.rb +8 -0
- data/lib/dcc/v3/list.rb +8 -0
- data/lib/dcc/v3/location.rb +8 -0
- data/lib/dcc/v3/measurement_meta_data.rb +8 -0
- data/lib/dcc/v3/measurement_meta_data_list.rb +8 -0
- data/lib/dcc/v3/measurement_result.rb +8 -0
- data/lib/dcc/v3/measurement_result_list.rb +8 -0
- data/lib/dcc/v3/measuring_equipment.rb +8 -0
- data/lib/dcc/v3/measuring_equipment_list.rb +8 -0
- data/lib/dcc/v3/namespace.rb +7 -0
- data/lib/dcc/v3/quantity.rb +49 -0
- data/lib/dcc/v3/ref_type_definition.rb +8 -0
- data/lib/dcc/v3/ref_type_definition_list.rb +8 -0
- data/lib/dcc/v3/resp_person.rb +8 -0
- data/lib/dcc/v3/resp_person_list.rb +8 -0
- data/lib/dcc/v3/result.rb +8 -0
- data/lib/dcc/v3/result_list.rb +8 -0
- data/lib/dcc/v3/rich_content.rb +8 -0
- data/lib/dcc/v3/software.rb +8 -0
- data/lib/dcc/v3/software_list.rb +8 -0
- data/lib/dcc/v3/statement.rb +8 -0
- data/lib/dcc/v3/statement_list.rb +8 -0
- data/lib/dcc/v3/string_with_lang.rb +8 -0
- data/lib/dcc/v3/text.rb +8 -0
- data/lib/dcc/v3/used_method.rb +8 -0
- data/lib/dcc/v3/used_method_list.rb +8 -0
- data/lib/dcc/v3/xml_blob.rb +8 -0
- data/lib/dcc/v3.rb +111 -0
- data/lib/dcc/validate/business_rules.rb +121 -0
- data/lib/dcc/validate/issue.rb +56 -0
- data/lib/dcc/validate/result.rb +105 -0
- data/lib/dcc/validate/schematron/profile.rb +64 -0
- data/lib/dcc/validate/schematron/rule.rb +49 -0
- data/lib/dcc/validate/schematron/rules/administrative_data_completeness.rb +42 -0
- data/lib/dcc/validate/schematron/rules/base.rb +15 -0
- data/lib/dcc/validate/schematron/rules/date_range_check.rb +41 -0
- data/lib/dcc/validate/schematron/rules/id_refid_linking.rb +61 -0
- data/lib/dcc/validate/schematron/rules/influence_conditions_placement.rb +58 -0
- data/lib/dcc/validate/schematron/rules/iso_code_validation.rb +53 -0
- data/lib/dcc/validate/schematron/rules/language_code_dedup.rb +39 -0
- data/lib/dcc/validate/schematron/rules/non_si_declaration.rb +82 -0
- data/lib/dcc/validate/schematron/rules/release_format_check.rb +44 -0
- data/lib/dcc/validate/schematron/rules/schema_version_check.rb +31 -0
- data/lib/dcc/validate/schematron/rules/uncertainty_consistency.rb +58 -0
- data/lib/dcc/validate/schematron/rules/unit_format_check.rb +74 -0
- data/lib/dcc/validate/schematron/rules/used_methods_placement.rb +65 -0
- data/lib/dcc/validate/schematron/rules/used_software_placement.rb +43 -0
- data/lib/dcc/validate/schematron/rules/xml_list_spacing.rb +42 -0
- data/lib/dcc/validate/schematron/rules.rb +30 -0
- data/lib/dcc/validate/schematron.rb +22 -0
- data/lib/dcc/validate/severity.rb +39 -0
- data/lib/dcc/validate/xsd.rb +97 -0
- data/lib/dcc/validate.rb +15 -0
- data/lib/dcc/version.rb +5 -0
- data/lib/dcc/versioned_parser.rb +48 -0
- data/lib/dcc.rb +141 -0
- metadata +425 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:itemType` — single calibrated item: name, equipmentClass,
|
|
6
|
+
# description, manufacturer, model, identifications.
|
|
7
|
+
module Item
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :name, :text
|
|
14
|
+
attribute :equipment_class, :equipmentClass, collection: true
|
|
15
|
+
attribute :description, :richContent
|
|
16
|
+
attribute :manufacturer, :contactNotStrict
|
|
17
|
+
attribute :model, :string
|
|
18
|
+
attribute :identifications, :identifications
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
namespace ::Dcc::Namespace::Dcc
|
|
22
|
+
element "item"
|
|
23
|
+
ordered
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "refId", to: :ref_id
|
|
26
|
+
map_attribute "refType", to: :ref_type
|
|
27
|
+
map_element "name", to: :name
|
|
28
|
+
map_element "equipmentClass", to: :equipment_class
|
|
29
|
+
map_element "description", to: :description
|
|
30
|
+
map_element "manufacturer", to: :manufacturer
|
|
31
|
+
map_element "model", to: :model
|
|
32
|
+
map_element "identifications", to: :identifications
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:itemListType` — container of `dcc:item`. Also has its own name,
|
|
6
|
+
# equipmentClass, description, owner, identifications.
|
|
7
|
+
module ItemList
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :name, :text
|
|
14
|
+
attribute :equipment_class, :equipmentClass, collection: true
|
|
15
|
+
attribute :description, :richContent
|
|
16
|
+
attribute :owner, :contact
|
|
17
|
+
attribute :identifications, :identifications
|
|
18
|
+
attribute :item, :item, collection: true
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
namespace ::Dcc::Namespace::Dcc
|
|
22
|
+
element "items"
|
|
23
|
+
ordered
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "refId", to: :ref_id
|
|
26
|
+
map_attribute "refType", to: :ref_type
|
|
27
|
+
map_element "name", to: :name
|
|
28
|
+
map_element "equipmentClass", to: :equipment_class
|
|
29
|
+
map_element "description", to: :description
|
|
30
|
+
map_element "owner", to: :owner
|
|
31
|
+
map_element "identifications", to: :identifications
|
|
32
|
+
map_element "item", to: :item
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:listType` — recursive list of quantities or sub-lists. Same
|
|
6
|
+
# ancillary sections as Quantity (usedMethods, usedSoftware, etc.).
|
|
7
|
+
module List
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :table_dimension, :integer
|
|
14
|
+
attribute :name, :text
|
|
15
|
+
attribute :date_time, :date_time
|
|
16
|
+
attribute :quantity, :quantity, collection: true
|
|
17
|
+
attribute :list, :list, collection: true
|
|
18
|
+
attribute :used_methods, :usedMethods
|
|
19
|
+
attribute :used_software, :softwareList
|
|
20
|
+
attribute :influence_conditions, :influenceConditions
|
|
21
|
+
attribute :measurement_meta_data, :measurementMetaData
|
|
22
|
+
|
|
23
|
+
xml do
|
|
24
|
+
namespace ::Dcc::Namespace::Dcc
|
|
25
|
+
element "list"
|
|
26
|
+
ordered
|
|
27
|
+
map_attribute "id", to: :id
|
|
28
|
+
map_attribute "refId", to: :ref_id
|
|
29
|
+
map_attribute "refType", to: :ref_type
|
|
30
|
+
map_attribute "tableDimension", to: :table_dimension
|
|
31
|
+
map_element "name", to: :name
|
|
32
|
+
map_element "dateTime", to: :date_time
|
|
33
|
+
map_element "quantity", to: :quantity
|
|
34
|
+
map_element "list", to: :list
|
|
35
|
+
map_element "usedMethods", to: :used_methods
|
|
36
|
+
map_element "usedSoftware", to: :used_software
|
|
37
|
+
map_element "influenceConditions", to: :influence_conditions
|
|
38
|
+
map_element "measurementMetaData", to: :measurement_meta_data
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:locationType` — physical address. Choice of `city`, `countryCode`,
|
|
6
|
+
# `postCode`, `postOfficeBox`, `state`, `street`, `streetNo`, `further`.
|
|
7
|
+
module Location
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :city, :string
|
|
11
|
+
attribute :country_code, :string
|
|
12
|
+
attribute :post_code, :string
|
|
13
|
+
attribute :post_office_box, :string
|
|
14
|
+
attribute :state, :string
|
|
15
|
+
attribute :street, :string
|
|
16
|
+
attribute :street_no, :string
|
|
17
|
+
attribute :further, :string
|
|
18
|
+
|
|
19
|
+
xml do
|
|
20
|
+
namespace ::Dcc::Namespace::Dcc
|
|
21
|
+
element "location"
|
|
22
|
+
ordered
|
|
23
|
+
map_element "city", to: :city
|
|
24
|
+
map_element "countryCode", to: :country_code
|
|
25
|
+
map_element "postCode", to: :post_code
|
|
26
|
+
map_element "postOfficeBox", to: :post_office_box
|
|
27
|
+
map_element "state", to: :state
|
|
28
|
+
map_element "street", to: :street
|
|
29
|
+
map_element "streetNo", to: :street_no
|
|
30
|
+
map_element "further", to: :further
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measurementMetaDataType` — single metadata statement block (a
|
|
6
|
+
# specialized statement for measurement-level metadata).
|
|
7
|
+
module MeasurementMetaData
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
include ::Dcc::Base::Statement
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measurementMetaDataListType` — collection of `dcc:metaData`.
|
|
6
|
+
module MeasurementMetaDataList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :ref_id, :string
|
|
11
|
+
attribute :ref_type, :string
|
|
12
|
+
attribute :meta_data, :metaData, collection: true
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace ::Dcc::Namespace::Dcc
|
|
16
|
+
element "measurementMetaData"
|
|
17
|
+
ordered
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "refId", to: :ref_id
|
|
20
|
+
map_attribute "refType", to: :ref_type
|
|
21
|
+
map_element "metaData", to: :meta_data
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measurementResultType` — single result block containing name,
|
|
6
|
+
# usedMethods, usedSoftware, measuringEquipments, influenceConditions,
|
|
7
|
+
# results.
|
|
8
|
+
module MeasurementResult
|
|
9
|
+
def self.included(klass)
|
|
10
|
+
klass.class_eval do
|
|
11
|
+
attribute :id, :string
|
|
12
|
+
attribute :ref_id, :string
|
|
13
|
+
attribute :ref_type, :string
|
|
14
|
+
attribute :name, :text
|
|
15
|
+
attribute :description, :text
|
|
16
|
+
attribute :used_methods, :usedMethods
|
|
17
|
+
attribute :used_software, :softwareList
|
|
18
|
+
attribute :measuring_equipments, :measuringEquipments
|
|
19
|
+
attribute :influence_conditions, :influenceConditions
|
|
20
|
+
attribute :results, :results
|
|
21
|
+
|
|
22
|
+
xml do
|
|
23
|
+
namespace ::Dcc::Namespace::Dcc
|
|
24
|
+
element "measurementResult"
|
|
25
|
+
ordered
|
|
26
|
+
map_attribute "id", to: :id
|
|
27
|
+
map_attribute "refId", to: :ref_id
|
|
28
|
+
map_attribute "refType", to: :ref_type
|
|
29
|
+
map_element "name", to: :name
|
|
30
|
+
map_element "description", to: :description
|
|
31
|
+
map_element "usedMethods", to: :used_methods
|
|
32
|
+
map_element "usedSoftware", to: :used_software
|
|
33
|
+
map_element "measuringEquipments", to: :measuring_equipments
|
|
34
|
+
map_element "influenceConditions", to: :influence_conditions
|
|
35
|
+
map_element "results", to: :results
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measurementResultListType` — collection of `dcc:measurementResult`.
|
|
6
|
+
# Also serves as the root element under `digitalCalibrationCertificate`.
|
|
7
|
+
module MeasurementResultList
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :measurement_result, :measurementResult, collection: true
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
namespace ::Dcc::Namespace::Dcc
|
|
17
|
+
element "measurementResults"
|
|
18
|
+
ordered
|
|
19
|
+
map_attribute "id", to: :id
|
|
20
|
+
map_attribute "refId", to: :ref_id
|
|
21
|
+
map_attribute "refType", to: :ref_type
|
|
22
|
+
map_element "measurementResult", to: :measurement_result
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measuringEquipmentType` — single instrument used during calibration.
|
|
6
|
+
module MeasuringEquipment
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :ref_id, :string
|
|
11
|
+
attribute :ref_type, :string
|
|
12
|
+
attribute :name, :text
|
|
13
|
+
attribute :equipment_class, :equipmentClass, collection: true
|
|
14
|
+
attribute :description, :richContent
|
|
15
|
+
attribute :certificate, :previousReport
|
|
16
|
+
attribute :manufacturer, :contactNotStrict
|
|
17
|
+
attribute :model, :string
|
|
18
|
+
attribute :identifications, :identifications
|
|
19
|
+
attribute :installed_software, :softwareList
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
namespace ::Dcc::Namespace::Dcc
|
|
23
|
+
element "measuringEquipment"
|
|
24
|
+
ordered
|
|
25
|
+
map_attribute "id", to: :id
|
|
26
|
+
map_attribute "refId", to: :ref_id
|
|
27
|
+
map_attribute "refType", to: :ref_type
|
|
28
|
+
map_element "name", to: :name
|
|
29
|
+
map_element "equipmentClass", to: :equipment_class
|
|
30
|
+
map_element "description", to: :description
|
|
31
|
+
map_element "certificate", to: :certificate
|
|
32
|
+
map_element "manufacturer", to: :manufacturer
|
|
33
|
+
map_element "model", to: :model
|
|
34
|
+
map_element "identifications", to: :identifications
|
|
35
|
+
map_element "installedSoftware", to: :installed_software
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:measuringEquipmentListType` — container of measuring equipment
|
|
6
|
+
# plus shared name/equipmentClass/description/owner/identifications.
|
|
7
|
+
module MeasuringEquipmentList
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :name, :text
|
|
14
|
+
attribute :equipment_class, :equipmentClass, collection: true
|
|
15
|
+
attribute :description, :richContent
|
|
16
|
+
attribute :owner, :contact
|
|
17
|
+
attribute :identifications, :identifications
|
|
18
|
+
attribute :measuring_equipment, :measuringEquipment, collection: true
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
namespace ::Dcc::Namespace::Dcc
|
|
22
|
+
element "measuringEquipments"
|
|
23
|
+
ordered
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "refId", to: :ref_id
|
|
26
|
+
map_attribute "refType", to: :ref_type
|
|
27
|
+
map_element "name", to: :name
|
|
28
|
+
map_element "equipmentClass", to: :equipment_class
|
|
29
|
+
map_element "description", to: :description
|
|
30
|
+
map_element "owner", to: :owner
|
|
31
|
+
map_element "identifications", to: :identifications
|
|
32
|
+
map_element "measuringEquipment", to: :measuring_equipment
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:quantityType` — DCC quantity wrapper around a D-SI quantity element.
|
|
6
|
+
# The XSD allows any of: si:real, si:complex, si:constant, si:hybrid,
|
|
7
|
+
# si:list, si:realListXMLList, si:complexListXMLList, or noQuantity.
|
|
8
|
+
#
|
|
9
|
+
# We use Option B (one attribute per substitution element) — the most
|
|
10
|
+
# reliable pattern in current lutaml-model. Each si:* element resolves
|
|
11
|
+
# via the active type registry to the version-appropriate D-SI class
|
|
12
|
+
# (`Dcc::Si::V2::Real` under `:dcc_v3`, `Dcc::Si::V1::Real` under
|
|
13
|
+
# `:dcc_v2`, etc.).
|
|
14
|
+
module Quantity
|
|
15
|
+
def self.included(klass)
|
|
16
|
+
klass.class_eval do
|
|
17
|
+
attribute :id, :string
|
|
18
|
+
attribute :ref_id, :string
|
|
19
|
+
attribute :ref_type, :string
|
|
20
|
+
attribute :name, :text
|
|
21
|
+
attribute :no_quantity, :string
|
|
22
|
+
# D-SI quantity substitutions (Option B)
|
|
23
|
+
attribute :real, :real, collection: true
|
|
24
|
+
attribute :complex, :complex, collection: true
|
|
25
|
+
attribute :constant, :constant, collection: true
|
|
26
|
+
attribute :hybrid, :hybrid, collection: true
|
|
27
|
+
attribute :real_list_xml_list, :realListXMLList, collection: true
|
|
28
|
+
attribute :complex_list_xml_list, :complexListXMLList, collection: true
|
|
29
|
+
attribute :list, :list, collection: true
|
|
30
|
+
# Ancillary DCC sections
|
|
31
|
+
attribute :used_methods, :usedMethods
|
|
32
|
+
attribute :used_software, :softwareList
|
|
33
|
+
attribute :influence_conditions, :influenceConditions
|
|
34
|
+
attribute :measurement_meta_data, :measurementMetaData
|
|
35
|
+
|
|
36
|
+
xml do
|
|
37
|
+
namespace ::Dcc::Namespace::Dcc
|
|
38
|
+
element "quantity"
|
|
39
|
+
ordered
|
|
40
|
+
map_attribute "id", to: :id
|
|
41
|
+
map_attribute "refId", to: :ref_id
|
|
42
|
+
map_attribute "refType", to: :ref_type
|
|
43
|
+
map_element "name", to: :name
|
|
44
|
+
map_element "noQuantity", to: :no_quantity
|
|
45
|
+
map_element "real", to: :real
|
|
46
|
+
map_element "complex", to: :complex
|
|
47
|
+
map_element "constant", to: :constant
|
|
48
|
+
map_element "hybrid", to: :hybrid
|
|
49
|
+
map_element "realListXMLList", to: :real_list_xml_list
|
|
50
|
+
map_element "complexListXMLList", to: :complex_list_xml_list
|
|
51
|
+
map_element "list", to: :list
|
|
52
|
+
map_element "usedMethods", to: :used_methods
|
|
53
|
+
map_element "usedSoftware", to: :used_software
|
|
54
|
+
map_element "influenceConditions", to: :influence_conditions
|
|
55
|
+
map_element "measurementMetaData", to: :measurement_meta_data
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:refTypeDefinitionType` (v3.4+) — declares a refType namespace and
|
|
6
|
+
# source link. Used in `administrativeData/refTypeDefinitions`.
|
|
7
|
+
module RefTypeDefinition
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :ref_type, :string
|
|
11
|
+
attribute :name, :text
|
|
12
|
+
attribute :description, :richContent
|
|
13
|
+
attribute :namespace, :string
|
|
14
|
+
attribute :link, :string
|
|
15
|
+
attribute :release, :string
|
|
16
|
+
attribute :value, :string
|
|
17
|
+
attribute :procedure, :string
|
|
18
|
+
|
|
19
|
+
xml do
|
|
20
|
+
namespace ::Dcc::Namespace::Dcc
|
|
21
|
+
element "refTypeDefinition"
|
|
22
|
+
ordered
|
|
23
|
+
map_attribute "refType", to: :ref_type
|
|
24
|
+
map_element "name", to: :name
|
|
25
|
+
map_element "description", to: :description
|
|
26
|
+
map_element "namespace", to: :namespace
|
|
27
|
+
map_element "link", to: :link
|
|
28
|
+
map_element "release", to: :release
|
|
29
|
+
map_element "value", to: :value
|
|
30
|
+
map_element "procedure", to: :procedure
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:refTypeDefinitionListType` — collection of `dcc:refTypeDefinition`.
|
|
6
|
+
module RefTypeDefinitionList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :ref_type_definition, :refTypeDefinition, collection: true
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
namespace ::Dcc::Namespace::Dcc
|
|
13
|
+
element "refTypeDefinitions"
|
|
14
|
+
ordered
|
|
15
|
+
map_element "refTypeDefinition", to: :ref_type_definition
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:respPersonType` — responsible person with role flags for digital
|
|
6
|
+
# sealing and signing.
|
|
7
|
+
module RespPerson
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :person, :contact
|
|
14
|
+
attribute :description, :text
|
|
15
|
+
attribute :main_signer, :boolean
|
|
16
|
+
attribute :crypt_electronic_seal, :string
|
|
17
|
+
attribute :crypt_electronic_signature, :string
|
|
18
|
+
attribute :crypt_electronic_time_stamp, :string
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
namespace ::Dcc::Namespace::Dcc
|
|
22
|
+
element "respPerson"
|
|
23
|
+
ordered
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "refId", to: :ref_id
|
|
26
|
+
map_attribute "refType", to: :ref_type
|
|
27
|
+
map_element "person", to: :person
|
|
28
|
+
map_element "description", to: :description
|
|
29
|
+
map_element "mainSigner", to: :main_signer
|
|
30
|
+
map_element "cryptElectronicSeal", to: :crypt_electronic_seal
|
|
31
|
+
map_element "cryptElectronicSignature", to: :crypt_electronic_signature
|
|
32
|
+
map_element "cryptElectronicTimeStamp", to: :crypt_electronic_time_stamp
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:respPersonListType` — collection of `dcc:respPerson`.
|
|
6
|
+
module RespPersonList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :ref_id, :string
|
|
11
|
+
attribute :ref_type, :string
|
|
12
|
+
attribute :resp_person, :respPerson, collection: true
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace ::Dcc::Namespace::Dcc
|
|
16
|
+
element "respPersons"
|
|
17
|
+
ordered
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "refId", to: :ref_id
|
|
20
|
+
map_attribute "refType", to: :ref_type
|
|
21
|
+
map_element "respPerson", to: :resp_person
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:resultType` — single named result carrying a `dcc:data` block.
|
|
6
|
+
module Result
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :ref_id, :string
|
|
11
|
+
attribute :ref_type, :string
|
|
12
|
+
attribute :name, :text
|
|
13
|
+
attribute :description, :text
|
|
14
|
+
attribute :data, :data, collection: true
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace ::Dcc::Namespace::Dcc
|
|
18
|
+
element "result"
|
|
19
|
+
ordered
|
|
20
|
+
map_attribute "id", to: :id
|
|
21
|
+
map_attribute "refId", to: :ref_id
|
|
22
|
+
map_attribute "refType", to: :ref_type
|
|
23
|
+
map_element "name", to: :name
|
|
24
|
+
map_element "description", to: :description
|
|
25
|
+
map_element "data", to: :data
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:resultListType` — collection of `dcc:result`.
|
|
6
|
+
module ResultList
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
attribute :id, :string
|
|
10
|
+
attribute :ref_id, :string
|
|
11
|
+
attribute :ref_type, :string
|
|
12
|
+
attribute :result, :result, collection: true
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace ::Dcc::Namespace::Dcc
|
|
16
|
+
element "results"
|
|
17
|
+
ordered
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "refId", to: :ref_id
|
|
20
|
+
map_attribute "refType", to: :ref_type
|
|
21
|
+
map_element "result", to: :result
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:richContentType` (v3.4+) — combines text, files, and formulae into
|
|
6
|
+
# one content block. We model it as an ordered collection of variants.
|
|
7
|
+
module RichContent
|
|
8
|
+
def self.included(klass)
|
|
9
|
+
klass.class_eval do
|
|
10
|
+
attribute :id, :string
|
|
11
|
+
attribute :ref_id, :string
|
|
12
|
+
attribute :ref_type, :string
|
|
13
|
+
attribute :text, :text, collection: true
|
|
14
|
+
attribute :formula, :formula, collection: true
|
|
15
|
+
attribute :byte_data, :byteData, collection: true
|
|
16
|
+
attribute :file, :byteData, collection: true
|
|
17
|
+
|
|
18
|
+
xml do
|
|
19
|
+
namespace ::Dcc::Namespace::Dcc
|
|
20
|
+
element "richContent"
|
|
21
|
+
ordered
|
|
22
|
+
map_attribute "id", to: :id
|
|
23
|
+
map_attribute "refId", to: :ref_id
|
|
24
|
+
map_attribute "refType", to: :ref_type
|
|
25
|
+
map_element "text", to: :text
|
|
26
|
+
map_element "formula", to: :formula
|
|
27
|
+
map_element "byteData", to: :byte_data
|
|
28
|
+
map_element "file", to: :file
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dcc
|
|
4
|
+
module Base
|
|
5
|
+
# `dcc:softwareType` — name + release + optional type enum + description.
|
|
6
|
+
# v3.4 adds the `type` enum (application/bios/driver/editor/firmware/
|
|
7
|
+
# library/os/other).
|
|
8
|
+
module Software
|
|
9
|
+
def self.included(klass)
|
|
10
|
+
klass.class_eval do
|
|
11
|
+
attribute :id, :string
|
|
12
|
+
attribute :ref_id, :string
|
|
13
|
+
attribute :ref_type, :string
|
|
14
|
+
attribute :name, :text
|
|
15
|
+
attribute :release, :string
|
|
16
|
+
attribute :type, :string
|
|
17
|
+
attribute :description, :richContent
|
|
18
|
+
|
|
19
|
+
xml do
|
|
20
|
+
namespace ::Dcc::Namespace::Dcc
|
|
21
|
+
element "software"
|
|
22
|
+
ordered
|
|
23
|
+
map_attribute "id", to: :id
|
|
24
|
+
map_attribute "refId", to: :ref_id
|
|
25
|
+
map_attribute "refType", to: :ref_type
|
|
26
|
+
map_element "name", to: :name
|
|
27
|
+
map_element "release", to: :release
|
|
28
|
+
map_element "type", to: :type
|
|
29
|
+
map_element "description", to: :description
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|