80 """publish the current request, with an optional input rset""" |
80 """publish the current request, with an optional input rset""" |
81 raise NotImplementedError |
81 raise NotImplementedError |
82 |
82 |
83 # generic methods useful for concrete implementations ###################### |
83 # generic methods useful for concrete implementations ###################### |
84 |
84 |
85 def process_rql(self, rql): |
85 def process_rql(self): |
86 """execute rql if specified""" |
86 """execute rql if specified""" |
87 # XXX assigning to self really necessary? |
87 req = self._cw |
88 self.cw_rset = None |
88 rql = req.form.get('rql') |
89 if rql: |
89 if rql: |
90 self._cw.ensure_ro_rql(rql) |
90 req.ensure_ro_rql(rql) |
91 if not isinstance(rql, unicode): |
91 if not isinstance(rql, unicode): |
92 rql = unicode(rql, self._cw.encoding) |
92 rql = unicode(rql, req.encoding) |
93 pp = self._cw.vreg['components'].select_or_none('magicsearch', self._cw) |
93 pp = req.vreg['components'].select_or_none('magicsearch', req) |
94 if pp is not None: |
94 if pp is not None: |
95 self.cw_rset = pp.process_query(rql) |
95 return pp.process_query(rql) |
96 return self.cw_rset |
96 if 'eid' in req.form: |
|
97 return req.eid_rset(req.form['eid']) |
|
98 return None |
97 |
99 |
98 def notify_edited(self, entity): |
100 def notify_edited(self, entity): |
99 """called by edit_entity() to notify which entity is edited""" |
101 """called by edit_entity() to notify which entity is edited""" |
100 # NOTE: we can't use entity.rest_path() at this point because |
102 # NOTE: we can't use entity.rest_path() at this point because |
101 # rest_path() could rely on schema constraints (such as a required |
103 # rest_path() could rely on schema constraints (such as a required |