Sha256: 30de14f869301a3e3d5a61f036a8b357fd5b23ffdb0453a035aada57402ea78a

Contents?: true

Size: 1.71 KB

Versions: 234

Compression:

Stored size: 1.71 KB

Contents

require 'ea_support/uml13_ea_metamodel'
require 'ea_support/uml13_ea_metamodel_ext'
require 'ea_support/uml13_to_uml13_ea'
require 'ea_support/uml13_ea_to_uml13'
require 'ea_support/id_store'
require 'rgen/serializer/xmi11_serializer'
require 'rgen/instantiator/xmi11_instantiator'
require 'rgen/environment'

module EASupport
  
  FIXMAP = {
    :tags => {
      "EAStub" => proc { |tag, attr| 
        UML13EA::Class.new(:name => attr["name"]) if attr["UMLType"] == "Class"
      }
    }
  }
  
  INFO = XMI11Instantiator::INFO
  WARN = XMI11Instantiator::WARN
  ERROR = XMI11Instantiator::ERROR
  
  def self.instantiateUML13FromXMI11(envUML, fileName, options={})
    envUMLEA = RGen::Environment.new
    xmiInst = XMI11Instantiator.new(envUMLEA, FIXMAP, options[:loglevel] || ERROR)
    xmiInst.add_metamodel("omg.org/UML1.3", UML13EA)
    File.open(fileName) do |f|
      xmiInst.instantiate(f.read)
    end
    trans = UML13EAToUML13.new(envUMLEA, envUML)
    trans.transform
    trans.cleanModel if options[:clean_model]
  end

  def self.serializeUML13ToXMI11(envUML, fileName, options={})
    envUMLEA = RGen::Environment.new
    
    UML13EA.idStore = options[:keep_ids] ? 
      IdStore.new(File.dirname(fileName)+"/"+File.basename(fileName)+".ids") : IdStore.new
    
    UML13ToUML13EA.new(envUML, envUMLEA).transform
    
    File.open(fileName, "w") do |f|
      xmiSer = RGen::Serializer::XMI11Serializer.new(f)
      xmiSer.setNamespace("UML","omg.org/UML1.3")
      xmiSer.serialize(envUMLEA.find(:class => UML13EA::Model).first, 
        {:documentation => {:exporter => "Enterprise Architect", :exporterVersion => "2.5"}})
    end
    
    UML13EA.idStore.store
  end
  
end

Version data entries

234 entries across 234 versions & 3 rubygems

Version Path
puppet-4.10.5-x86-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.5-x64-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.5-universal-darwin lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.4 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.4-x86-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.4-x64-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.4-universal-darwin lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-retrospec-1.4.1 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.1 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.1-x86-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.1-x64-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.1-universal-darwin lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-retrospec-1.4.0 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.0 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.0-x86-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.0-x64-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.10.0-universal-darwin lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-retrospec-1.3.2 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.9.4 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb
puppet-4.9.4-x86-mingw32 lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb