1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 '''
20 A empty rendering class.
21
22 Created on Feb 2, 2012
23
24 @author: tmetsch
25 '''
26
27
29 '''
30 All renderings should derive from this class.
31 '''
32
34 '''
35 Constructor.
36
37 registry -- The registry used for this process.
38 '''
39 self.registry = registry
40
41 - def to_entity(self, headers, body, def_kind, extras):
42 '''
43 Given the HTTP headers and the body this method will convert the HTTP
44 data into an entity representation. Must return Resource or Link
45 instances.
46
47 headers -- The HTTP headers.
48 body -- The HTTP body.
49 def_kind -- If provided this kind is taken (Needed for update).
50 extras -- Passed on extra object.
51 '''
52 raise NotImplementedError()
53
55 '''
56 Given an entity it will return a HTTP body an header.
57
58 If it's a link make sure source, target attributes are set. If it's a
59 Resource make sure Links are presented properly.
60
61 entity -- The entity which is to rendered.
62 '''
63 raise NotImplementedError()
64
66 '''
67 Given the HTTP headers and the body this method will convert the HTTP
68 data into a set of entity representations. Must return a set of
69 Resource or Link instances.
70
71 headers -- The HTTP headers.
72 body -- The HTTP body.
73 extras -- Passed on extra object.
74 '''
75 raise NotImplementedError()
76
78 '''
79 Given an set of entities it will return a HTTP body an header.
80
81 entities -- The entities which will be rendered.
82 key -- Needed for uri-list (see RFC) and html rendering.
83 '''
84 raise NotImplementedError()
85
87 '''
88 Given an set of categories it will return a HTTP body an header.
89
90 categories -- The list of categories which is to be rendered.
91 '''
92 raise NotImplementedError()
93
95 '''
96 Given the HTTP headers and the body this method will convert the HTTP
97 data into an Action.
98
99 headers -- The HTTP headers.
100 body -- The HTTP body.
101 extras -- Passed on extra object.
102 '''
103 raise NotImplementedError()
104
106 '''
107 Given the HTTP headers and the body this method will convert the HTTP
108 data into a Mixins. Must return a list with Mixin instances.
109
110 headers -- The HTTP headers.
111 body -- The HTTP body.
112 extras -- Passed on extra object.
113 '''
114 raise NotImplementedError()
115
117 '''
118 Given the HTTP headers and the body this method will convert the HTTP
119 data into a list of categories and attributes.
120
121 headers -- The HTTP headers.
122 body -- The HTTP body.
123 extras -- Passed on extra object.
124 '''
125 raise NotImplementedError()
126