Package occi :: Package protocol :: Module html_rendering :: Class HTMLRendering
[hide private]
[frames] | no frames]

Class HTMLRendering

source code

         object --+    
                  |    
rendering.Rendering --+
                      |
                     HTMLRendering

A simple HTML website rendering for monitoring the service...

Instance Methods [hide private]
 
__init__(self, registry, css=None)
Constructor for HTML rendering.
source code
 
from_entity(self, entity)
Given an entity it will return a HTTP body an header.
source code
 
_from_entity_head_html(self, entity)
Private helper function which creates the first part of the HTML.
source code
 
from_entities(self, entities, key)
Given an set of entities it will return a HTTP body an header.
source code
 
from_categories(self, categories)
Given an set of categories it will return a HTTP body an header.
source code
 
to_action(self, headers, body, extras)
Given the HTTP headers and the body this method will convert the HTTP data into an Action.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from rendering.Rendering
 
get_filters(self, headers, body, extras)
Given the HTTP headers and the body this method will convert the HTTP data into a list of categories and attributes.
source code
 
to_entities(self, headers, body, extras)
Given the HTTP headers and the body this method will convert the HTTP data into a set of entity representations.
source code
 
to_entity(self, headers, body, def_kind, extras)
Given the HTTP headers and the body this method will convert the HTTP data into an entity representation.
source code
 
to_mixins(self, headers, body, extras)
Given the HTTP headers and the body this method will convert the HTTP data into a Mixins.
source code
Class Variables [hide private]
  mime_type = 'text/html'
  css = 'body { font-family: sans-serif; ...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, registry, css=None)
(Constructor)

source code 

Constructor for HTML rendering. Can be used to use other CSS.

registry -- Registry used in this service. css -- If provided this CSS is used.

Overrides: object.__init__

from_entity(self, entity)

source code 

Given an entity it will return a HTTP body an header.

If it's a link make sure source, target attributes are set. If it's a Resource make sure Links are presented properly.

entity -- The entity which is to rendered.

Overrides: rendering.Rendering.from_entity
(inherited documentation)

_from_entity_head_html(self, entity)

source code 

Private helper function which creates the first part of the HTML.

entity -- The entity to render.

from_entities(self, entities, key)

source code 

Given an set of entities it will return a HTTP body an header.

entities -- The entities which will be rendered. key -- Needed for uri-list (see RFC) and html rendering.

Overrides: rendering.Rendering.from_entities
(inherited documentation)

from_categories(self, categories)

source code 

Given an set of categories it will return a HTTP body an header.

categories -- The list of categories which is to be rendered.

Overrides: rendering.Rendering.from_categories
(inherited documentation)

to_action(self, headers, body, extras)

source code 

Given the HTTP headers and the body this method will convert the HTTP data into an Action.

headers -- The HTTP headers. body -- The HTTP body. extras -- Passed on extra object.

Overrides: rendering.Rendering.to_action
(inherited documentation)

Class Variable Details [hide private]

css

Value:
'body {             font-family: sans-serif;             font-size: 0.\
9em;             margin: 0;             padding: 0;            }      \
      #header {             background: #444;             border-top: \
5px solid #73c167;            }             #header ul {             l\
ist-style-type: none;             list-style-image: none;             \
margin: 0;             padding: 0;             height: 2em;           \
 }            #header li {             margin: 0.2em 0.5em 0.3em 0.5em\
;             font-weight: bold;             display: inline-block;   \
...