Class: ODDB::View::Admin::SequenceComposite

Inherits:
HtmlGrid::Composite show all
Includes:
SwissmedicSource
Defined in:
src/view/admin/sequence.rb

Direct Known Subclasses

ResellerSequenceComposite, RootSequenceComposite

Constant Summary

COMPONENTS =

AGENTS = View::Admin::SequenceAgents

{
  [0,0] =>  :sequence_name,
  [0,1] =>  View::Admin::SequenceInnerComposite,
  [0,2] =>  'composition',
  [0,3] =>  :composition_text,
  [0,4] =>  'active_agents',
  [0,5] =>  :compositions,
  [0,6] =>  :sequence_packages,
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] =>  'th',
  [0,2] =>  'subheading',
  [0,3] =>  'list',
  [0,4] =>  'subheading',
}
PACKAGES =
View::Admin::SequencePackages
SYMBOL_MAP =
{
  :composition_text => HtmlGrid::Value,
}

Instance Method Summary (collapse)

Methods included from SwissmedicSource

#format_source, #package_source, #registration_source, #sequence_source

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) compositions(model, session = @session)



517
518
519
# File 'src/view/admin/sequence.rb', line 517

def compositions(model, session=@session)
  Compositions.new(model.compositions, @session, self)
end

- (Object) sequence_name(model, session)



520
521
522
523
524
525
526
# File 'src/view/admin/sequence.rb', line 520

def sequence_name(model, session)
  [ 
    (model.company.name if model.company),
    model.name,
  ].compact.join(' - ')
  #HtmlGrid::Value.new('name', model, session, self)
end

- (Object) sequence_packages(model, session)



527
528
529
530
531
532
# File 'src/view/admin/sequence.rb', line 527

def sequence_packages(model, session)
  if(packages = model.packages)
    values = ODDB::PointerArray.new(packages.values, model.pointer)
    self::class::PACKAGES.new(values, session, self)
  end
end

- (Object) source(model, session = @session)



533
534
535
536
537
# File 'src/view/admin/sequence.rb', line 533

def source(model, session=@session)
  val = HtmlGrid::Value.new(:source, model, @session, self)
  val.value = sequence_source(model) if model
  val
end