Class: Lapillus::RemotePanel

Inherits:
Container show all
Defined in:
lib/lapillus/containers.rb

Overview

TODO: whats in a name

Instance Attribute Summary

Attributes inherited from Container

#components

Attributes inherited from Component

#behaviours, #identifier, #model, #property, #visible

Instance Method Summary collapse

Methods inherited from Container

#[], #add, add_component, #component, fileuploadfield, image, #initialize, label, listview, panel, password_textfield, #post, textarea, textfield

Methods inherited from Component

#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #initialize, #parent, #path, #response_page=, #session, #value, #webpage

Methods inherited from RenderableComponent

#initialize, #on_render, #render_behaviours, #render_component, #render_container, #render_to_element, #visible?

Constructor Details

This class inherits a constructor from Lapillus::Container

Instance Method Details

#default_htmlfileObject

duplicate with methods in webpage!



212
213
214
215
# File 'lib/lapillus/containers.rb', line 212

def default_htmlfile
  htmlfile = "html/" + self.class.to_s + ".html"
  File.new( htmlfile ) 
end

#render_2(template = default_htmlfile) ⇒ Object Also known as: render

duplicate with webpage!



202
203
204
205
206
207
208
# File 'lib/lapillus/containers.rb', line 202

def render_2(template=default_htmlfile)
  doc = REXML::Document.new template
  root_element = doc.root
  visitor = HtmlVisitor.new(self)
  root_element.accept(visitor)
  return doc.doctype.to_s + visitor.container_output.root.to_s.gsub(''',"'").gsub('"','"')
end

#render_children(visitor, template_element) ⇒ Object



193
194
195
196
197
198
199
# File 'lib/lapillus/containers.rb', line 193

def render_children(visitor, template_element)
  doc = REXML::Document.new default_htmlfile
  root_node = doc.root
  fragment = REXML::XPath.first( root_node, "//body")
  raise "Body element not found!" if fragment == nil
  super(visitor, fragment)
end