Esempio n. 1
0
    def get(self, names):
        name = names[0]

        if IPloneRestapiLayer.providedBy(self.request):
            noLongerProvides(self.request, IPloneRestapiLayer)

        context = queryMultiAdapter((self.context, self.request),
                                    name='dexterity-types')
        context = context.publishTraverse(self.request, name)
        serializer = ISerializeToJson(self)
        return serializer(context)
Esempio n. 2
0
    def reply_panel(self):
        name = self.params[0]
        panel = self.panel_by_name(name)
        if panel is None:
            self.request.response.setStatus(404)
            return

        # Panel child request
        if len(self.params) > 1:
            return IJsonCompatible(panel.get(self.params[1:]))

        # Panel request
        return IJsonCompatible(ISerializeToJson(panel)())
Esempio n. 3
0
 def reply_panel(self):
     panel = self.panel_by_name(self.controlpanel_name)
     if panel is None:
         self.request.response.setStatus(404)
         return
     return IJsonCompatible(ISerializeToJson(panel)())