コード例 #1
0
 def _map_omeka_item_element_itm_donation_date(self, object_builder, text):
     earliest_date = self._parse_date(text)
     object_builder.dates.append(
         Date.builder()
             .setEarliestDate(earliest_date)
             .setLatestDate(earliest_date)
             .setType(DateType.DONATION)
             .build()
     )
コード例 #2
0
 def _map_omeka_item_element_itm_accession_year(self, object_builder, text):
     try:
         year = int(text)
     except ValueError:
         self._logger.warn("unable to parse Accession Year '%s'", text)
         return
     earliest_date = \
         DateBound.builder()\
             .setParsedDateTime(java.util.Date(year - 1900, 0, 1))\
             .setParsedDateTimeGranularity(DateTimeGranularity.YEAR)\
             .setText(text)\
             .build()
     object_builder.dates.append(
         Date.builder()
             .setEarliestDate(earliest_date)
             .setLatestDate(earliest_date)
             .setType(DateType.ACCESSION)
             .build()
     )