Class: UuAppstudio::Cmd::AppboxCreateController

Inherits:
UU::OS::CMD::CommandController
  • Object
show all
Defined in:
app/controllers/appbox/create.rb

Constant Summary

CONTROLLER_URL_PATH =
'Appbox/create'

Instance Method Summary collapse

Instance Method Details

#on_exec(ctx) ⇒ Object

Parameters:

  • ctx (UU::OS::CMD::CommandContext)


13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/appbox/create.rb', line 13

def on_exec(ctx)
  UuAppstudio::Cmd::InputMethods.cmd(ctx) do
    app_card_uri = UuAppstudio::Cmd::Helpers.main_entity_uri(ctx)
    artifact_uri = UuAppstudio::Model::AppBox.create_artifact(app_card_uri, ctx.parameters)
    if ctx.parameters[:exportMetaModel]
      # invoke metamodel export
      ctx.parameters[:appboxUri] = artifact_uri
      client = UU::OS::CMD::CommandClient.new('uu-appstudio', UU::OS::Security::Session.current_session)
      client.invoke('Appbox/exportMetamodel', ctx.uu_uri, parameters: ctx.parameters)
    end
    return artifact_uri
  end
end