コード例 #1
0
ファイル: DA.py プロジェクト: bendavis78/zope
 def PUT(self, REQUEST, RESPONSE):
     """Handle put requests"""
     self.dav__init(REQUEST, RESPONSE)
     self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
     body = REQUEST.get('BODY', '')
     m = re.match('\s*<params>(.*)</params>\s*\n', body, re.I | re.S)
     if m:
         self.arguments_src = m.group(1)
         self._arg = parse(self.arguments_src)
         body = body[m.end():]
     template = body
     self.src = template
     self.template = t = self.template_class(template)
     t.cook()
     self._v_cache = {}, Bucket()
     RESPONSE.setStatus(204)
     return RESPONSE
コード例 #2
0
ファイル: DA.py プロジェクト: nacho22martin/tesis
 def PUT(self, REQUEST, RESPONSE):
     """Handle put requests"""
     self.dav__init(REQUEST, RESPONSE)
     self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
     body = REQUEST.get('BODY', '')
     m = re.match('\s*<params>(.*)</params>\s*\n', body, re.I | re.S)
     if m:
         self.arguments_src = m.group(1)
         self._arg=parse(self.arguments_src)
         body = body[m.end():]
     template = body
     self.src = template
     self.template=t=self.template_class(template)
     t.cook()
     self._v_cache={}, Bucket()
     RESPONSE.setStatus(204)
     return RESPONSE
コード例 #3
0
ファイル: DA.py プロジェクト: wpjunior/proled
    def manage_edit(
        self,
        title,
        connection_id,
        arguments,
        template,
        SUBMIT="Change",
        dtpref_cols="100%",
        dtpref_rows="20",
        REQUEST=None,
    ):
        """Change database method  properties

        The 'connection_id' argument is the id of a database connection
        that resides in the current folder or in a folder above the
        current folder.  The database should understand SQL.

        The 'arguments' argument is a string containing an arguments
        specification, as would be given in the SQL method cration form.

        The 'template' argument is a string containing the source for the
        SQL Template.
        """

        if self._size_changes.has_key(SUBMIT):
            return self._er(title, connection_id, arguments, template, SUBMIT, dtpref_cols, dtpref_rows, REQUEST)

        if self.wl_isLocked():
            raise ResourceLockedError, "SQL Method is locked via WebDAV"

        self.title = str(title)
        self.connection_id = str(connection_id)
        arguments = str(arguments)
        self.arguments_src = arguments
        self._arg = parse(arguments)
        template = str(template)
        self.src = template
        self.template = t = self.template_class(template)
        t.cook()
        self._v_cache = {}, Bucket()
        if REQUEST:
            if SUBMIT == "Change and Test":
                return self.manage_testForm(REQUEST)
            message = "ZSQL Method content changed"
            return self.manage_main(self, REQUEST, manage_tabs_message=message)
        return ""
コード例 #4
0
ファイル: DA.py プロジェクト: bendavis78/zope
    def manage_edit(self,
                    title,
                    connection_id,
                    arguments,
                    template,
                    SUBMIT='Change',
                    dtpref_cols='100%',
                    dtpref_rows='20',
                    REQUEST=None):
        """Change database method  properties

        The 'connection_id' argument is the id of a database connection
        that resides in the current folder or in a folder above the
        current folder.  The database should understand SQL.

        The 'arguments' argument is a string containing an arguments
        specification, as would be given in the SQL method cration form.

        The 'template' argument is a string containing the source for the
        SQL Template.
        """

        if self._size_changes.has_key(SUBMIT):
            return self._er(title, connection_id, arguments, template, SUBMIT,
                            dtpref_cols, dtpref_rows, REQUEST)

        if self.wl_isLocked():
            raise ResourceLockedError, 'SQL Method is locked via WebDAV'

        self.title = str(title)
        self.connection_id = str(connection_id)
        arguments = str(arguments)
        self.arguments_src = arguments
        self._arg = parse(arguments)
        template = str(template)
        self.src = template
        self.template = t = self.template_class(template)
        t.cook()
        self._v_cache = {}, Bucket()
        if REQUEST:
            if SUBMIT == 'Change and Test':
                return self.manage_testForm(REQUEST)
            message = 'ZSQL Method content changed'
            return self.manage_main(self, REQUEST, manage_tabs_message=message)
        return ''