Class: Lapillus::Webpage

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

Direct Known Subclasses

BookmarkableWebpage

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, label, listview, panel, password_textfield, #post, #render_container, textarea, textfield

Methods inherited from Component

#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #on_render, #parent, #path, #render_component, #response_page=, #session, #value, #visible?, #webpage

Constructor Details

#initializeWebpage

Returns a new instance of Webpage.



39
40
41
# File 'lib/lapillus/containers.rb', line 39

def initialize()
  super("")
end

Instance Method Details

#default_htmlfileObject



52
53
54
55
# File 'lib/lapillus/containers.rb', line 52

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

#render(html = default_htmlfile) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/lapillus/containers.rb', line 43

def render(html=default_htmlfile)
  # @html is al File
  #    html = @html if [email protected]?
  doc = REXML::Document.new html
  root_element = doc.root
  new_root_element = render_container(root_element)
  return doc.doctype.to_s + new_root_element.to_s.gsub(''',"'").gsub('"','"')
end