Exemple #1
0
    def webdav_server(self, name, group='Default', port=0, root='/',
                      content_db_name=None, connection=None):
        """
        Get the named WebDAV server.
        """
        if connection is None:
            server = WebDAVServer(name, group, port, root,
                                  content_db_name,
                                  connection=self.connection,
                                  save_connection=self.save_connection)
        else:
            server = WebDAVServer(name, group, port, root,
                                  content_db_name,
                                  connection=connection, save_connection=False)

        if connection is None:
            server = server.read(self.connection)
        else:
            server = server.read(connection)

        if server.server_type() != 'webdav':
            raise InvalidAPIRequest("Attempt to load {0} server as webdav" \
                                    .format(server.server_type()))

        return server
Exemple #2
0
    def xdbc_server(self, name, group='Default', port=0, root='/',
                    content_db_name=None, modules_db_name=None,
                    connection=None):
        """
        Get the named XDBC server.
        """
        if connection is None:
            server = XdbcServer(name, group, port, root,
                                content_db_name, modules_db_name,
                                connection=self.connection,
                                save_connection=self.save_connection)
        else:
            server = XdbcServer(name, group, port, root,
                                content_db_name, modules_db_name,
                                connection=connection, save_connection=False)

        if connection is None:
            server = server.read(self.connection)
        else:
            server = server.read(connection)

        if server.server_type() != 'xdbc':
            raise InvalidAPIRequest("Attempt to load {0} server as xdbc" \
                                    .format(server.server_type()))

        return server