Esempio n. 1
0
    def identify(self):
        """
        Retrieve information about the repository.

        :returns: an :py:class:`oaipmh.common.Identify` object describing the
            repository.
        """
        current_site = Site.objects.get_current().domain
        return Identify(
            "%s (MyTardis)" % (settings.DEFAULT_INSTITUTION, ),
            'http://%s%s' % (current_site, reverse('oaipmh-endpoint')), '2.0',
            self._get_admin_emails(current_site), datetime.fromtimestamp(0),
            'no', 'YYYY-MM-DDThh:mm:ssZ', [])
Esempio n. 2
0
    def identify(self):
        """
        Retrieve information about the repository.

        :returns: an :py:class:`oaipmh.common.Identify` object describing the
            repository.
        :rtype: oaipmh.common.Identify
        """
        current_site = Site.objects.get_current().domain
        if getattr(settings, 'CSRF_COOKIE_SECURE', False):
            protocol = 'https'
        else:
            protocol = 'http'
        return Identify(
            "%s (MyTardis)" % (settings.DEFAULT_INSTITUTION, ),
            '%s://%s%s' % (protocol, current_site, reverse('oaipmh-endpoint')),
            '2.0', self._get_admin_emails(current_site),
            datetime.fromtimestamp(0), 'no', 'YYYY-MM-DDThh:mm:ssZ', [])
Esempio n. 3
0
 def identify(self):
     """Return an Identify object describing the repository."""
     return Identify(self.repositoryName, self.baseURL,
                     self.protocolVersion, self.adminEmails,
                     self.earliestDatestamp, self.deletedRecord,
                     self.granularity, self.compression)