Package occi :: Package protocol :: Module json_rendering :: Class JsonRendering
[hide private]
[frames] | no frames]

Class JsonRendering

source code

         object --+    
                  |    
rendering.Rendering --+
                      |
                     JsonRendering

This is a rendering which will use the HTTP header to place the information in an syntax and semantics as defined in the OCCI specification.

Instance Methods [hide private]
 
from_entity(self, entity)
Given an entity it will return a HTTP body an header.
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

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

    Inherited from rendering.Rendering
 
__init__(self, registry)
Constructor.
source code
 
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_action(self, headers, body, extras)
Given the HTTP headers and the body this method will convert the HTTP data into an Action.
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 = 'application/occi+json'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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_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)