'Extract zone root data from JSON.'

def extract_data(self, metadata):

    err = []
    url = self.decode_href(metadata[u'url'])
    if (url == self.path):
        err.append((u'url    "%s"    should    be    the    non-zone    path' % url))
    if (metadata[u'locale'] != self.locale):
        err.append((u'locale    "%s"    should    be    the    same    as    the    path    locale' % metadata[u'locale']))
    if err:
        return {u'errors': err, u'doc_locale': self.locale, u'metadata_locale': metadata[u'locale'], u'metadata_url': url, u'zone_path': self.path}
    else:
        return {u'doc_path': url, u'zone_path': self.path}
