######################################################################
##
## Copyright (c) LIFL 1999
## The GOODE team of the LIFL
## University of Lille, France
## All rights reserved
##
## The CorbaWeb script associated to the OMG IDL CORBA::InterfaceDef
## interface.
##
######################################################################

# Each action must have two arguments: the first one refers to the
# current CORBA object and the second one refers to a CorbaWeb
# ActionContext instance.

######################################################################
## This action displays the contain of a CORBA::InterfaceDef.
######################################################################

proc view(interface, ac)
{
  generate_contained_information(interface, ac)

  # obtains base interfaces of this CORBA::InterfaceDef object.
  base_interfaces = interface.base_interfaces

  if (base_interfaces.length > 0) {
    ac.h2("Base interfaces")
    ac.println("<ul>")
    for bi in base_interfaces {
      ac.print("<li> ") ac.anchorToObject(bi, bi.absolute_name)
    }
    ac.println("</ul>")
  }

  # generates a list of the contained objects.
  generate_contents_list(interface, ac)

  ac.h2("Specific Actions")

  # generates a form to apply the lookup method.
  generate_lookup_form(interface, ac)

}

######################################################################
## Declaration of these actions into the CorbaWeb ActionRepository.
######################################################################

declareAction("view", view,
              "Views the contain of a CORBA::InterfaceDef object")

######################################################################
# end of file 'CorbaWeb/actions/CORBA_InterfaceDef'
######################################################################
