ea 0.1.0 → 0.1.4
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 +4 -4
- data/CLAUDE.md +125 -0
- data/Rakefile +12 -4
- data/TODO.next/00-publish-blocking-bugs.md +74 -0
- data/TODO.next/01-standalone-ea-gem-identity.md +76 -0
- data/TODO.next/02-optional-lutaml-uml-dependency.md +47 -0
- data/TODO.next/03-slim-lutaml-uml.md +79 -0
- data/TODO.next/04-loader-registry-for-uml-repository.md +49 -0
- data/TODO.next/05-extract-shared-transformer-methods.md +14 -0
- data/TODO.next/06-deduplicate-stereotype-loading.md +17 -0
- data/TODO.next/07-transformer-registry-in-factory.md +20 -0
- data/TODO.next/08-connector-type-registry.md +27 -0
- data/TODO.next/09-element-renderer-registry.md +29 -0
- data/TODO.next/10-connector-renderer-lsp.md +18 -0
- data/TODO.next/11-consolidate-style-knowledge.md +33 -0
- data/TODO.next/12-data-driven-from-db-row.md +24 -0
- data/TODO.next/13-extract-duplicated-methods.md +17 -0
- data/TODO.next/14-remove-dead-code.md +10 -0
- data/TODO.next/15-narrow-exception-handling.md +39 -0
- data/TODO.next/16-repository-indexes.md +28 -0
- data/TODO.next/17-fix-spec-quality-and-coverage.md +32 -0
- data/TODO.next/18-xmi-tool-specific-parser-architecture.md +172 -0
- data/TODO.next/19-fix-ea-gemspec-dependency-declarations.md +56 -0
- data/TODO.next/20-ci-requires-unreleased-lutaml-uml.md +63 -0
- data/TODO.next/21-qeatoxmi-via-xmi-gem.md +340 -0
- data/TODO.next/22-strip-respond-to-from-qeatoxmi-specs.md +32 -0
- data/TODO.next/23-cleanup-idallocator.md +41 -0
- data/TODO.next/24-tighten-parity-specs.md +42 -0
- data/TODO.next/25-sparx-eaid-format-for-synthesized-ids.md +62 -0
- data/TODO.next/26-fix-uppervalue-lowervalue-count-gap.md +51 -0
- data/TODO.next/27-extract-cardinality-module.md +68 -0
- data/TODO.next/28-extract-xml-sanitizer.md +51 -0
- data/TODO.next/29-ocp-registry-for-classifier-builders.md +58 -0
- data/TODO.next/30-struct-return-for-association-end.md +37 -0
- data/TODO.next/31-idallocator-specs.md +27 -0
- data/TODO.next/32-phase2-gap-sentinel-specs.md +53 -0
- data/TODO.next/33-normalize-lower-cleanup.md +30 -0
- data/TODO.next/34-document-member-end-order-rt-prefix.md +29 -0
- data/TODO.next/35-walk-runstate-for-instance-slots.md +76 -0
- data/TODO.next/36-wire-interface-realization.md +50 -0
- data/TODO.next/37-visibility-returns-real-booleans.md +36 -0
- data/config/diagram_styles.yml +200 -0
- data/config/model_transformations.yml +266 -0
- data/config/qea_schema.yml +1024 -0
- data/docs/ea_to_uml_type_mapping.md +89 -0
- data/docs/xmi_qea_conversion_capabilities.md +99 -0
- data/examples/lur/20251010_current_plateau_v5.1.lur +0 -0
- data/examples/lur/basic.lur +0 -0
- data/examples/lur/test-output.lur +0 -0
- data/examples/lur/test.lur +0 -0
- data/examples/lur_basic_usage.rb +221 -0
- data/examples/lur_cli_workflow.rb +263 -0
- data/examples/lur_statistics.rb +326 -0
- data/examples/qea/20251010_current_plateau_v5.1.qea +0 -0
- data/examples/qea/ArcGISWorkspace_template.qea +0 -0
- data/examples/qea/README_qea_parser.adoc +230 -0
- data/examples/qea/UmlModel_template.qea +0 -0
- data/examples/qea/basic.qea +0 -0
- data/examples/qea/simple.qea +0 -0
- data/examples/qea/simple_example.qea +0 -0
- data/examples/qea/test.qea +0 -0
- data/examples/qea_standalone_query.rb +73 -0
- data/examples/qea_to_repository.rb +51 -0
- data/examples/smoke_test_real_qea.rb +81 -0
- data/exe/ea +7 -0
- data/lib/ea/cli/app.rb +72 -0
- data/lib/ea/cli/command/base.rb +80 -0
- data/lib/ea/cli/command/convert.rb +62 -0
- data/lib/ea/cli/command/diagrams.rb +81 -0
- data/lib/ea/cli/command/list.rb +61 -0
- data/lib/ea/cli/command/parse.rb +29 -0
- data/lib/ea/cli/command/stats.rb +20 -0
- data/lib/ea/cli/command/validate.rb +41 -0
- data/lib/ea/cli/command.rb +15 -0
- data/lib/ea/cli/error.rb +34 -0
- data/lib/ea/cli/output/formatter.rb +34 -0
- data/lib/ea/cli/output/json_formatter.rb +20 -0
- data/lib/ea/cli/output/table_formatter.rb +42 -0
- data/lib/ea/cli/output/yaml_formatter.rb +20 -0
- data/lib/ea/cli/output.rb +56 -0
- data/lib/ea/cli.rb +17 -0
- data/lib/ea/diagram/configuration.rb +379 -0
- data/lib/ea/diagram/element_renderers/base_renderer.rb +77 -0
- data/lib/ea/diagram/element_renderers/class_renderer.rb +323 -0
- data/lib/ea/diagram/element_renderers/connector_renderer.rb +41 -0
- data/lib/ea/diagram/element_renderers/package_renderer.rb +61 -0
- data/lib/ea/diagram/element_renderers.rb +43 -0
- data/lib/ea/diagram/extractor.rb +560 -0
- data/lib/ea/diagram/layout_engine.rb +170 -0
- data/lib/ea/diagram/path_builder.rb +202 -0
- data/lib/ea/diagram/style_parser.rb +42 -0
- data/lib/ea/diagram/style_resolver.rb +276 -0
- data/lib/ea/diagram/svg_renderer.rb +274 -0
- data/lib/ea/diagram/util.rb +73 -0
- data/lib/ea/diagram.rb +47 -0
- data/lib/ea/qea/benchmark.rb +210 -0
- data/lib/ea/qea/database.rb +308 -0
- data/lib/ea/qea/factory/association_builder.rb +203 -0
- data/lib/ea/qea/factory/association_transformer.rb +91 -0
- data/lib/ea/qea/factory/attribute_tag_transformer.rb +57 -0
- data/lib/ea/qea/factory/attribute_transformer.rb +93 -0
- data/lib/ea/qea/factory/base_transformer.rb +177 -0
- data/lib/ea/qea/factory/class_transformer.rb +116 -0
- data/lib/ea/qea/factory/constraint_transformer.rb +75 -0
- data/lib/ea/qea/factory/data_type_transformer.rb +77 -0
- data/lib/ea/qea/factory/diagram_transformer.rb +157 -0
- data/lib/ea/qea/factory/document_builder.rb +283 -0
- data/lib/ea/qea/factory/ea_to_uml_factory.rb +229 -0
- data/lib/ea/qea/factory/enum_transformer.rb +74 -0
- data/lib/ea/qea/factory/generalization_builder.rb +227 -0
- data/lib/ea/qea/factory/generalization_transformer.rb +98 -0
- data/lib/ea/qea/factory/instance_transformer.rb +68 -0
- data/lib/ea/qea/factory/object_property_transformer.rb +58 -0
- data/lib/ea/qea/factory/operation_transformer.rb +66 -0
- data/lib/ea/qea/factory/package_transformer.rb +145 -0
- data/lib/ea/qea/factory/reference_resolver.rb +99 -0
- data/lib/ea/qea/factory/stereotype_loader.rb +39 -0
- data/lib/ea/qea/factory/tagged_value_transformer.rb +38 -0
- data/lib/ea/qea/factory/transformer_registry.rb +80 -0
- data/lib/ea/qea/factory.rb +37 -0
- data/lib/ea/qea/file_detector.rb +178 -0
- data/lib/ea/qea/infrastructure/database_connection.rb +100 -0
- data/lib/ea/qea/infrastructure/schema_reader.rb +136 -0
- data/lib/ea/qea/infrastructure/table_reader.rb +224 -0
- data/lib/ea/qea/infrastructure.rb +12 -0
- data/lib/ea/qea/models/base_model.rb +59 -0
- data/lib/ea/qea/models/ea_attribute.rb +109 -0
- data/lib/ea/qea/models/ea_attribute_tag.rb +100 -0
- data/lib/ea/qea/models/ea_complexity_type.rb +79 -0
- data/lib/ea/qea/models/ea_connector.rb +160 -0
- data/lib/ea/qea/models/ea_connector_type.rb +60 -0
- data/lib/ea/qea/models/ea_constraint_type.rb +63 -0
- data/lib/ea/qea/models/ea_datatype.rb +104 -0
- data/lib/ea/qea/models/ea_diagram.rb +115 -0
- data/lib/ea/qea/models/ea_diagram_link.rb +78 -0
- data/lib/ea/qea/models/ea_diagram_object.rb +73 -0
- data/lib/ea/qea/models/ea_diagram_type.rb +56 -0
- data/lib/ea/qea/models/ea_document.rb +63 -0
- data/lib/ea/qea/models/ea_object.rb +223 -0
- data/lib/ea/qea/models/ea_object_constraint.rb +53 -0
- data/lib/ea/qea/models/ea_object_property.rb +87 -0
- data/lib/ea/qea/models/ea_object_type.rb +73 -0
- data/lib/ea/qea/models/ea_operation.rb +127 -0
- data/lib/ea/qea/models/ea_operation_param.rb +76 -0
- data/lib/ea/qea/models/ea_package.rb +78 -0
- data/lib/ea/qea/models/ea_script.rb +62 -0
- data/lib/ea/qea/models/ea_status_type.rb +66 -0
- data/lib/ea/qea/models/ea_stereotype.rb +57 -0
- data/lib/ea/qea/models/ea_tagged_value.rb +99 -0
- data/lib/ea/qea/models/ea_xref.rb +165 -0
- data/lib/ea/qea/models.rb +35 -0
- data/lib/ea/qea/repositories/base_repository.rb +225 -0
- data/lib/ea/qea/repositories/object_repository.rb +219 -0
- data/lib/ea/qea/repositories.rb +10 -0
- data/lib/ea/qea/services/configuration.rb +211 -0
- data/lib/ea/qea/services/database_loader.rb +191 -0
- data/lib/ea/qea/services.rb +10 -0
- data/lib/ea/qea/validation/association_validator.rb +73 -0
- data/lib/ea/qea/validation/attribute_validator.rb +91 -0
- data/lib/ea/qea/validation/base_validator.rb +331 -0
- data/lib/ea/qea/validation/class_validator.rb +121 -0
- data/lib/ea/qea/validation/database/circular_reference_validator.rb +109 -0
- data/lib/ea/qea/validation/database/orphan_validator.rb +153 -0
- data/lib/ea/qea/validation/database/referential_integrity_validator.rb +128 -0
- data/lib/ea/qea/validation/database.rb +16 -0
- data/lib/ea/qea/validation/diagram_validator.rb +112 -0
- data/lib/ea/qea/validation/formatters/json_formatter.rb +137 -0
- data/lib/ea/qea/validation/formatters/text_formatter.rb +235 -0
- data/lib/ea/qea/validation/formatters.rb +12 -0
- data/lib/ea/qea/validation/operation_validator.rb +71 -0
- data/lib/ea/qea/validation/package_validator.rb +111 -0
- data/lib/ea/qea/validation/validation_engine.rb +387 -0
- data/lib/ea/qea/validation/validation_message.rb +144 -0
- data/lib/ea/qea/validation/validation_result.rb +210 -0
- data/lib/ea/qea/validation/validator_registry.rb +134 -0
- data/lib/ea/qea/validation.rb +28 -0
- data/lib/ea/qea/verification/comparison_result.rb +264 -0
- data/lib/ea/qea/verification/document_normalizer.rb +169 -0
- data/lib/ea/qea/verification/document_verifier.rb +322 -0
- data/lib/ea/qea/verification/element_comparator.rb +277 -0
- data/lib/ea/qea/verification/structure_matcher.rb +287 -0
- data/lib/ea/qea/verification.rb +14 -0
- data/lib/ea/qea.rb +185 -0
- data/lib/ea/transformations/configuration.rb +333 -0
- data/lib/ea/transformations/format_registry.rb +366 -0
- data/lib/ea/transformations/parsers/base_parser.rb +482 -0
- data/lib/ea/transformations/parsers/qea_parser.rb +401 -0
- data/lib/ea/transformations/parsers/xmi_parser.rb +243 -0
- data/lib/ea/transformations/transformation_engine.rb +390 -0
- data/lib/ea/transformations.rb +85 -0
- data/lib/ea/transformers/qea_to_xmi/association_end.rb +19 -0
- data/lib/ea/transformers/qea_to_xmi/cardinality.rb +96 -0
- data/lib/ea/transformers/qea_to_xmi/context.rb +106 -0
- data/lib/ea/transformers/qea_to_xmi/guid_format.rb +56 -0
- data/lib/ea/transformers/qea_to_xmi/id_allocator.rb +92 -0
- data/lib/ea/transformers/qea_to_xmi/run_state.rb +107 -0
- data/lib/ea/transformers/qea_to_xmi/transformer.rb +607 -0
- data/lib/ea/transformers/qea_to_xmi/visibility.rb +73 -0
- data/lib/ea/transformers/qea_to_xmi.rb +29 -0
- data/lib/ea/transformers/uml_to_xmi/id_generator.rb +54 -0
- data/lib/ea/transformers/uml_to_xmi/transformer.rb +152 -0
- data/lib/ea/transformers/uml_to_xmi/writer.rb +96 -0
- data/lib/ea/transformers/uml_to_xmi.rb +16 -0
- data/lib/ea/transformers.rb +34 -0
- data/lib/ea/version.rb +1 -1
- data/lib/ea/xmi/liquid_drops/association_drop.rb +56 -0
- data/lib/ea/xmi/liquid_drops/attribute_drop.rb +72 -0
- data/lib/ea/xmi/liquid_drops/cardinality_drop.rb +35 -0
- data/lib/ea/xmi/liquid_drops/connector_drop.rb +54 -0
- data/lib/ea/xmi/liquid_drops/constraint_drop.rb +29 -0
- data/lib/ea/xmi/liquid_drops/data_type_drop.rb +63 -0
- data/lib/ea/xmi/liquid_drops/dependency_drop.rb +36 -0
- data/lib/ea/xmi/liquid_drops/diagram_drop.rb +34 -0
- data/lib/ea/xmi/liquid_drops/enum_drop.rb +49 -0
- data/lib/ea/xmi/liquid_drops/enum_owned_literal_drop.rb +25 -0
- data/lib/ea/xmi/liquid_drops/generalization_attribute_drop.rb +87 -0
- data/lib/ea/xmi/liquid_drops/generalization_drop.rb +127 -0
- data/lib/ea/xmi/liquid_drops/klass_drop.rb +191 -0
- data/lib/ea/xmi/liquid_drops/operation_drop.rb +29 -0
- data/lib/ea/xmi/liquid_drops/package_drop.rb +108 -0
- data/lib/ea/xmi/liquid_drops/root_drop.rb +34 -0
- data/lib/ea/xmi/liquid_drops/source_target_drop.rb +43 -0
- data/lib/ea/xmi/lookup_service.rb +89 -0
- data/lib/ea/xmi/parser.rb +919 -0
- data/lib/ea/xmi.rb +35 -0
- data/lib/ea.rb +10 -1
- metadata +382 -9
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# Represents a diagram object from the t_diagramobjects table
|
|
7
|
+
#
|
|
8
|
+
# This model represents the placement of UML elements (classes, packages,
|
|
9
|
+
# etc.) on specific diagrams, including their position and styling.
|
|
10
|
+
class EaDiagramObject < BaseModel
|
|
11
|
+
attribute :diagram_id, Lutaml::Model::Type::Integer
|
|
12
|
+
attribute :ea_object_id, Lutaml::Model::Type::Integer
|
|
13
|
+
attribute :recttop, Lutaml::Model::Type::Integer
|
|
14
|
+
attribute :rectleft, Lutaml::Model::Type::Integer
|
|
15
|
+
attribute :rectright, Lutaml::Model::Type::Integer
|
|
16
|
+
attribute :rectbottom, Lutaml::Model::Type::Integer
|
|
17
|
+
attribute :sequence, Lutaml::Model::Type::Integer
|
|
18
|
+
attribute :objectstyle, Lutaml::Model::Type::String
|
|
19
|
+
attribute :instance_id, Lutaml::Model::Type::Integer
|
|
20
|
+
|
|
21
|
+
def self.primary_key_column
|
|
22
|
+
:instance_id
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.table_name
|
|
26
|
+
"t_diagramobjects"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
COLUMN_MAP = {
|
|
31
|
+
"Object_ID" => :ea_object_id,
|
|
32
|
+
}.freeze
|
|
33
|
+
|
|
34
|
+
def self.column_map
|
|
35
|
+
COLUMN_MAP
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Get the bounding box of the diagram object
|
|
39
|
+
# @return [Hash] Hash with :top, :left, :right, :bottom, :width, :height
|
|
40
|
+
def bounding_box
|
|
41
|
+
{
|
|
42
|
+
top: recttop,
|
|
43
|
+
left: rectleft,
|
|
44
|
+
right: rectright,
|
|
45
|
+
bottom: rectbottom,
|
|
46
|
+
width: rectright - rectleft,
|
|
47
|
+
height: rectbottom - recttop,
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Get the center point of the diagram object
|
|
52
|
+
# @return [Hash] Hash with :x, :y coordinates
|
|
53
|
+
def center_point
|
|
54
|
+
{
|
|
55
|
+
x: (rectleft + rectright) / 2,
|
|
56
|
+
y: (recttop + rectbottom) / 2,
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Parse ObjectStyle string into a hash
|
|
61
|
+
# @return [Hash] Parsed style attributes
|
|
62
|
+
def parsed_style
|
|
63
|
+
return {} unless objectstyle
|
|
64
|
+
|
|
65
|
+
objectstyle.split(";").each_with_object({}) do |pair, hash|
|
|
66
|
+
key, value = pair.split("=", 2)
|
|
67
|
+
hash[key] = value if key && value
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# Represents a diagram type definition from t_diagramtypes table
|
|
7
|
+
#
|
|
8
|
+
# This table provides reference data for diagram types available in EA.
|
|
9
|
+
# These define the types of UML diagrams that can be created.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# diagram_type = EaDiagramType.new
|
|
13
|
+
# diagram_type.diagram_type #=> "Logical"
|
|
14
|
+
# diagram_type.name #=> "Logical View"
|
|
15
|
+
# diagram_type.package_id #=> 1
|
|
16
|
+
class EaDiagramType < BaseModel
|
|
17
|
+
attribute :diagram_type, Lutaml::Model::Type::String
|
|
18
|
+
attribute :name, Lutaml::Model::Type::String
|
|
19
|
+
attribute :package_id, Lutaml::Model::Type::Integer
|
|
20
|
+
|
|
21
|
+
def self.table_name
|
|
22
|
+
"t_diagramtypes"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Primary key is Diagram_Type (text)
|
|
26
|
+
def self.primary_key_column
|
|
27
|
+
"Diagram_Type"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Friendly type name
|
|
31
|
+
# @return [String]
|
|
32
|
+
def type_name
|
|
33
|
+
diagram_type
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Check if this is a class diagram
|
|
37
|
+
# @return [Boolean]
|
|
38
|
+
def class_diagram?
|
|
39
|
+
diagram_type == "Logical"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Check if this is an activity diagram
|
|
43
|
+
# @return [Boolean]
|
|
44
|
+
def activity_diagram?
|
|
45
|
+
diagram_type == "Activity"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Check if this is a use case diagram
|
|
49
|
+
# @return [Boolean]
|
|
50
|
+
def use_case_diagram?
|
|
51
|
+
diagram_type == "UseCase"
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# Represents a document from the t_document table in EA database
|
|
7
|
+
# Stores documentation style templates and artifacts
|
|
8
|
+
class EaDocument < BaseModel
|
|
9
|
+
attribute :doc_id, Lutaml::Model::Type::String
|
|
10
|
+
attribute :doc_name, Lutaml::Model::Type::String
|
|
11
|
+
attribute :doc_type, Lutaml::Model::Type::String
|
|
12
|
+
attribute :str_content, Lutaml::Model::Type::String
|
|
13
|
+
attribute :bin_content, Lutaml::Model::Type::String
|
|
14
|
+
attribute :element_id, Lutaml::Model::Type::String
|
|
15
|
+
|
|
16
|
+
def self.primary_key_column
|
|
17
|
+
:doc_id
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.table_name
|
|
21
|
+
"t_document"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
COLUMN_MAP = {
|
|
26
|
+
"DocID" => :doc_id,
|
|
27
|
+
"DocName" => :doc_name,
|
|
28
|
+
"DocType" => :doc_type,
|
|
29
|
+
"StrContent" => :str_content,
|
|
30
|
+
"BinContent" => :bin_content,
|
|
31
|
+
"ElementID" => :element_id,
|
|
32
|
+
}.freeze
|
|
33
|
+
|
|
34
|
+
def self.column_map
|
|
35
|
+
COLUMN_MAP
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Convenience aliases
|
|
39
|
+
alias_method :id, :doc_id
|
|
40
|
+
alias_method :name, :doc_name
|
|
41
|
+
alias_method :type, :doc_type
|
|
42
|
+
|
|
43
|
+
# Check if this is a style document
|
|
44
|
+
# @return [Boolean]
|
|
45
|
+
def style_document?
|
|
46
|
+
doc_type == "SSDOCSTYLE"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Check if document has string content
|
|
50
|
+
# @return [Boolean]
|
|
51
|
+
def has_content?
|
|
52
|
+
!str_content.nil? && !str_content.empty?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Check if document has binary content
|
|
56
|
+
# @return [Boolean]
|
|
57
|
+
def has_binary_content?
|
|
58
|
+
!bin_content.nil? && !bin_content.empty?
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
class EaObject < BaseModel
|
|
7
|
+
attribute :ea_object_id, Lutaml::Model::Type::Integer
|
|
8
|
+
attribute :object_type, Lutaml::Model::Type::String
|
|
9
|
+
attribute :diagram_id, Lutaml::Model::Type::Integer
|
|
10
|
+
attribute :name, Lutaml::Model::Type::String
|
|
11
|
+
attribute :alias, Lutaml::Model::Type::String
|
|
12
|
+
attribute :author, Lutaml::Model::Type::String
|
|
13
|
+
attribute :version, Lutaml::Model::Type::String
|
|
14
|
+
attribute :note, Lutaml::Model::Type::String
|
|
15
|
+
attribute :package_id, Lutaml::Model::Type::Integer
|
|
16
|
+
attribute :stereotype, Lutaml::Model::Type::String
|
|
17
|
+
attribute :ntype, Lutaml::Model::Type::Integer
|
|
18
|
+
attribute :complexity, Lutaml::Model::Type::String
|
|
19
|
+
attribute :effort, Lutaml::Model::Type::Integer
|
|
20
|
+
attribute :style, Lutaml::Model::Type::String
|
|
21
|
+
attribute :backcolor, Lutaml::Model::Type::Integer
|
|
22
|
+
attribute :borderstyle, Lutaml::Model::Type::Integer
|
|
23
|
+
attribute :borderwidth, Lutaml::Model::Type::Integer
|
|
24
|
+
attribute :fontcolor, Lutaml::Model::Type::Integer
|
|
25
|
+
attribute :bordercolor, Lutaml::Model::Type::Integer
|
|
26
|
+
attribute :createddate, Lutaml::Model::Type::String
|
|
27
|
+
attribute :modifieddate, Lutaml::Model::Type::String
|
|
28
|
+
attribute :status, Lutaml::Model::Type::String
|
|
29
|
+
attribute :abstract, Lutaml::Model::Type::String
|
|
30
|
+
attribute :tagged, Lutaml::Model::Type::Integer
|
|
31
|
+
attribute :pdata1, Lutaml::Model::Type::String
|
|
32
|
+
attribute :pdata2, Lutaml::Model::Type::String
|
|
33
|
+
attribute :pdata3, Lutaml::Model::Type::String
|
|
34
|
+
attribute :pdata4, Lutaml::Model::Type::String
|
|
35
|
+
attribute :pdata5, Lutaml::Model::Type::String
|
|
36
|
+
attribute :concurrency, Lutaml::Model::Type::String
|
|
37
|
+
attribute :visibility, Lutaml::Model::Type::String
|
|
38
|
+
attribute :persistence, Lutaml::Model::Type::String
|
|
39
|
+
attribute :cardinality, Lutaml::Model::Type::String
|
|
40
|
+
attribute :gentype, Lutaml::Model::Type::String
|
|
41
|
+
attribute :genfile, Lutaml::Model::Type::String
|
|
42
|
+
attribute :header1, Lutaml::Model::Type::String
|
|
43
|
+
attribute :header2, Lutaml::Model::Type::String
|
|
44
|
+
attribute :phase, Lutaml::Model::Type::String
|
|
45
|
+
attribute :scope, Lutaml::Model::Type::String
|
|
46
|
+
attribute :genoption, Lutaml::Model::Type::String
|
|
47
|
+
attribute :genlinks, Lutaml::Model::Type::String
|
|
48
|
+
attribute :classifier, Lutaml::Model::Type::Integer
|
|
49
|
+
attribute :ea_guid, Lutaml::Model::Type::String
|
|
50
|
+
attribute :parentid, Lutaml::Model::Type::Integer
|
|
51
|
+
attribute :runstate, Lutaml::Model::Type::String
|
|
52
|
+
attribute :classifier_guid, Lutaml::Model::Type::String
|
|
53
|
+
attribute :tpos, Lutaml::Model::Type::Integer
|
|
54
|
+
attribute :isroot, Lutaml::Model::Type::Integer
|
|
55
|
+
attribute :isleaf, Lutaml::Model::Type::Integer
|
|
56
|
+
attribute :isspec, Lutaml::Model::Type::Integer
|
|
57
|
+
attribute :isactive, Lutaml::Model::Type::Integer
|
|
58
|
+
attribute :stateflags, Lutaml::Model::Type::String
|
|
59
|
+
attribute :packageflags, Lutaml::Model::Type::String
|
|
60
|
+
attribute :multiplicity, Lutaml::Model::Type::String
|
|
61
|
+
attribute :styleex, Lutaml::Model::Type::String
|
|
62
|
+
attribute :actionflags, Lutaml::Model::Type::String
|
|
63
|
+
attribute :eventflags, Lutaml::Model::Type::String
|
|
64
|
+
|
|
65
|
+
COLUMN_MAP = {
|
|
66
|
+
"Object_ID" => :ea_object_id,
|
|
67
|
+
"Object_Type" => :object_type,
|
|
68
|
+
"Diagram_ID" => :diagram_id,
|
|
69
|
+
"Name" => :name,
|
|
70
|
+
"Alias" => :alias,
|
|
71
|
+
"Author" => :author,
|
|
72
|
+
"Version" => :version,
|
|
73
|
+
"Note" => :note,
|
|
74
|
+
"Package_ID" => :package_id,
|
|
75
|
+
"Stereotype" => :stereotype,
|
|
76
|
+
"NType" => :ntype,
|
|
77
|
+
"Complexity" => :complexity,
|
|
78
|
+
"Effort" => :effort,
|
|
79
|
+
"Style" => :style,
|
|
80
|
+
"BackColor" => :backcolor,
|
|
81
|
+
"BorderStyle" => :borderstyle,
|
|
82
|
+
"BorderWidth" => :borderwidth,
|
|
83
|
+
"Fontcolor" => :fontcolor,
|
|
84
|
+
"Bordercolor" => :bordercolor,
|
|
85
|
+
"CreatedDate" => :createddate,
|
|
86
|
+
"ModifiedDate" => :modifieddate,
|
|
87
|
+
"Status" => :status,
|
|
88
|
+
"Abstract" => :abstract,
|
|
89
|
+
"Tagged" => :tagged,
|
|
90
|
+
"PDATA1" => :pdata1,
|
|
91
|
+
"PDATA2" => :pdata2,
|
|
92
|
+
"PDATA3" => :pdata3,
|
|
93
|
+
"PDATA4" => :pdata4,
|
|
94
|
+
"PDATA5" => :pdata5,
|
|
95
|
+
"Concurrency" => :concurrency,
|
|
96
|
+
"Visibility" => :visibility,
|
|
97
|
+
"Persistence" => :persistence,
|
|
98
|
+
"Cardinality" => :cardinality,
|
|
99
|
+
"GenType" => :gentype,
|
|
100
|
+
"GenFile" => :genfile,
|
|
101
|
+
"Header1" => :header1,
|
|
102
|
+
"Header2" => :header2,
|
|
103
|
+
"Phase" => :phase,
|
|
104
|
+
"Scope" => :scope,
|
|
105
|
+
"GenOption" => :genoption,
|
|
106
|
+
"GenLinks" => :genlinks,
|
|
107
|
+
"Classifier" => :classifier,
|
|
108
|
+
"ea_guid" => :ea_guid,
|
|
109
|
+
"ParentID" => :parentid,
|
|
110
|
+
"RunState" => :runstate,
|
|
111
|
+
"Classifier_guid" => :classifier_guid,
|
|
112
|
+
"TPos" => :tpos,
|
|
113
|
+
"IsRoot" => :isroot,
|
|
114
|
+
"IsLeaf" => :isleaf,
|
|
115
|
+
"IsSpec" => :isspec,
|
|
116
|
+
"IsActive" => :isactive,
|
|
117
|
+
"StateFlags" => :stateflags,
|
|
118
|
+
"PackageFlags" => :packageflags,
|
|
119
|
+
"Multiplicity" => :multiplicity,
|
|
120
|
+
"StyleEx" => :styleex,
|
|
121
|
+
"ActionFlags" => :actionflags,
|
|
122
|
+
"EventFlags" => :eventflags,
|
|
123
|
+
}.freeze
|
|
124
|
+
|
|
125
|
+
def self.column_map
|
|
126
|
+
COLUMN_MAP
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def self.primary_key_column
|
|
130
|
+
:ea_object_id
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def self.table_name
|
|
134
|
+
"t_object"
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def abstract?
|
|
138
|
+
abstract == "1"
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def uml_class?
|
|
142
|
+
object_type == "Class"
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def interface?
|
|
146
|
+
object_type == "Interface"
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def component?
|
|
150
|
+
object_type == "Component"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def package?
|
|
154
|
+
object_type == "Package"
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def enumeration?
|
|
158
|
+
object_type == "Enumeration"
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def data_type?
|
|
162
|
+
object_type == "DataType"
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def instance?
|
|
166
|
+
object_type == "Object"
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def root?
|
|
170
|
+
isroot == 1
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def leaf?
|
|
174
|
+
isleaf == 1
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Resolve the transformer registry key for this object's type.
|
|
178
|
+
# Considers both object_type and stereotype (e.g., a Class with
|
|
179
|
+
# stereotype "enumeration" transforms as an enum).
|
|
180
|
+
#
|
|
181
|
+
# EA object types that have no UML model equivalent return nil and
|
|
182
|
+
# are skipped during transformation:
|
|
183
|
+
#
|
|
184
|
+
# Text — diagram text annotation box. A rendering hint,
|
|
185
|
+
# not a model element. Currently dropped; its
|
|
186
|
+
# content is not preserved in the UML document.
|
|
187
|
+
# (Faithful mapping to UML Comment is pending a
|
|
188
|
+
# `comments` collection on Package.)
|
|
189
|
+
#
|
|
190
|
+
# ProxyConnector — EA-internal stub representing a connector that
|
|
191
|
+
# crosses package boundaries. Structural plumbing
|
|
192
|
+
# with no UML equivalent. Dropped.
|
|
193
|
+
#
|
|
194
|
+
# Note — diagram note. Same situation as Text: rendering
|
|
195
|
+
# hint, not a model element. Dropped.
|
|
196
|
+
#
|
|
197
|
+
# @return [Symbol, nil] Registry key or nil if not a UML model element
|
|
198
|
+
def transformer_type
|
|
199
|
+
if enumeration? || stereotype_is?("enumeration")
|
|
200
|
+
:enumeration
|
|
201
|
+
elsif data_type?
|
|
202
|
+
:data_type
|
|
203
|
+
elsif uml_class? || interface?
|
|
204
|
+
:class
|
|
205
|
+
elsif instance?
|
|
206
|
+
:instance
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def stereotype_is?(expected)
|
|
211
|
+
return false unless stereotype
|
|
212
|
+
|
|
213
|
+
stereotype.downcase == expected
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# @return [Integer] tpos for tree-position ordering
|
|
217
|
+
def sort_position
|
|
218
|
+
tpos || 0
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# EA Object Constraint model
|
|
7
|
+
#
|
|
8
|
+
# Represents OCL constraints attached to UML objects in the
|
|
9
|
+
# t_objectconstraint table.
|
|
10
|
+
#
|
|
11
|
+
# @example Create from database row
|
|
12
|
+
# row = {
|
|
13
|
+
# "Object_ID" => 4,
|
|
14
|
+
# "Constraint" => "count(self.legalConstraints) >= 1",
|
|
15
|
+
# "ConstraintType" => "Invariant",
|
|
16
|
+
# "Weight" => "0.0",
|
|
17
|
+
# "Notes" => nil,
|
|
18
|
+
# "Status" => "Approved"
|
|
19
|
+
# }
|
|
20
|
+
# constraint = EaObjectConstraint.from_db_row(row)
|
|
21
|
+
class EaObjectConstraint < BaseModel
|
|
22
|
+
attribute :constraint_id, :integer
|
|
23
|
+
attribute :ea_object_id, :integer
|
|
24
|
+
attribute :constraint, :string
|
|
25
|
+
attribute :constraint_type, :string
|
|
26
|
+
attribute :weight, :float
|
|
27
|
+
attribute :notes, :string
|
|
28
|
+
attribute :status, :string
|
|
29
|
+
|
|
30
|
+
# @return [Symbol] Primary key column name
|
|
31
|
+
def self.primary_key_column
|
|
32
|
+
:constraint_id
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @return [String] Database table name
|
|
36
|
+
def self.table_name
|
|
37
|
+
"t_objectconstraint"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
COLUMN_MAP = {
|
|
42
|
+
"ConstraintID" => :constraint_id,
|
|
43
|
+
"Object_ID" => :ea_object_id,
|
|
44
|
+
"ConstraintType" => :constraint_type,
|
|
45
|
+
}.freeze
|
|
46
|
+
|
|
47
|
+
def self.column_map
|
|
48
|
+
COLUMN_MAP
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# EA Object Property model
|
|
7
|
+
#
|
|
8
|
+
# Represents object-level properties (custom key-value metadata)
|
|
9
|
+
# in the t_objectproperties table. These are metadata properties
|
|
10
|
+
# specific to GML/XML Schema encoding.
|
|
11
|
+
#
|
|
12
|
+
# @example Create from database row
|
|
13
|
+
# row = {
|
|
14
|
+
# "PropertyID" => 1,
|
|
15
|
+
# "Object_ID" => 684,
|
|
16
|
+
# "Property" => "isCollection",
|
|
17
|
+
# "Value" => "false",
|
|
18
|
+
# "Notes" => "Values: true,false...",
|
|
19
|
+
# "ea_guid" => "{GUID}"
|
|
20
|
+
# }
|
|
21
|
+
# property = EaObjectProperty.from_db_row(row)
|
|
22
|
+
class EaObjectProperty < BaseModel
|
|
23
|
+
attribute :property_id, :integer
|
|
24
|
+
attribute :ea_object_id, :integer
|
|
25
|
+
attribute :property, :string
|
|
26
|
+
attribute :value, :string
|
|
27
|
+
attribute :notes, :string
|
|
28
|
+
attribute :ea_guid, :string
|
|
29
|
+
|
|
30
|
+
# @return [Symbol] Primary key column name
|
|
31
|
+
def self.primary_key_column
|
|
32
|
+
:property_id
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @return [String] Database table name
|
|
36
|
+
def self.table_name
|
|
37
|
+
"t_objectproperties"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
COLUMN_MAP = {
|
|
42
|
+
"PropertyID" => :property_id,
|
|
43
|
+
"Object_ID" => :ea_object_id,
|
|
44
|
+
}.freeze
|
|
45
|
+
|
|
46
|
+
def self.column_map
|
|
47
|
+
COLUMN_MAP
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Get property name
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil] Property name
|
|
53
|
+
def name
|
|
54
|
+
property
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Get property value as string
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil] Property value
|
|
60
|
+
def property_value
|
|
61
|
+
value
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Parse boolean value
|
|
65
|
+
#
|
|
66
|
+
# @return [Boolean, nil] Boolean value if parseable, nil otherwise
|
|
67
|
+
def boolean_value
|
|
68
|
+
return nil if value.nil?
|
|
69
|
+
|
|
70
|
+
case value.downcase
|
|
71
|
+
when "true", "1", "yes"
|
|
72
|
+
true
|
|
73
|
+
when "false", "0", "no"
|
|
74
|
+
false
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Check if property is boolean type
|
|
79
|
+
#
|
|
80
|
+
# @return [Boolean] true if value is boolean
|
|
81
|
+
def boolean?
|
|
82
|
+
!boolean_value.nil?
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ea
|
|
4
|
+
module Qea
|
|
5
|
+
module Models
|
|
6
|
+
# Represents an object type definition from t_objecttypes table
|
|
7
|
+
#
|
|
8
|
+
# This table provides reference data for object/class types available
|
|
9
|
+
# in EA. These define what kinds of UML elements can be created.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# object_type = EaObjectType.new
|
|
13
|
+
# object_type.object_type #=> "Class"
|
|
14
|
+
# object_type.description #=> "UML Class"
|
|
15
|
+
# object_type.design_object? #=> false
|
|
16
|
+
class EaObjectType < BaseModel
|
|
17
|
+
attribute :object_type, Lutaml::Model::Type::String
|
|
18
|
+
attribute :description, Lutaml::Model::Type::String
|
|
19
|
+
attribute :designobject, Lutaml::Model::Type::Integer
|
|
20
|
+
attribute :imageid, Lutaml::Model::Type::Integer
|
|
21
|
+
|
|
22
|
+
def self.table_name
|
|
23
|
+
"t_objecttypes"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Primary key is Object_Type (text)
|
|
27
|
+
def self.primary_key_column
|
|
28
|
+
"Object_Type"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Friendly name for object type
|
|
32
|
+
# @return [String]
|
|
33
|
+
def name
|
|
34
|
+
object_type
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Check if this is a design object
|
|
38
|
+
# @return [Boolean]
|
|
39
|
+
def design_object?
|
|
40
|
+
designobject == 1
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Alias for readability
|
|
44
|
+
alias design_object designobject
|
|
45
|
+
alias image_id imageid
|
|
46
|
+
|
|
47
|
+
# Check if this is a Class type
|
|
48
|
+
# @return [Boolean]
|
|
49
|
+
def class_type?
|
|
50
|
+
object_type == "Class"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Check if this is an Interface type
|
|
54
|
+
# @return [Boolean]
|
|
55
|
+
def interface_type?
|
|
56
|
+
object_type == "Interface"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Check if this is a Package type
|
|
60
|
+
# @return [Boolean]
|
|
61
|
+
def package_type?
|
|
62
|
+
object_type == "Package"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Check if this is an Actor type
|
|
66
|
+
# @return [Boolean]
|
|
67
|
+
def actor_type?
|
|
68
|
+
object_type == "Actor"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|