Commits

Anonymous committed 451981d

prepare for 1.1 release

Added deleted_sets configuration option
Changed sorting of resources in sqlite backend
Changed ranged http requests in apache backend

  • Participants
  • Parent commits 09110d6
  • Tags MOAI-1.1.0

Comments (0)

Files changed (8)

 MOAI Changes
 ============
 
-MOAI 1.0.11 (unreleased)
+MOAI 1.1.0 (2010-04-08)
 -----------------------
 
 Changes
 ~~~~~~~
 
+- Added new config option `deleted_sets` which can be used to make all 
+  resources within a specific set `oai deleted` within the context of a 
+  specific feed. In many cases this is preferable compared to `disallowed_sets`
+  since resources will just dissapear when they are not allowed without
+  leaving a proper deleted resource behind.
+- Disable ranged HTTP requests in Apache mod_python backend. This was giving
+  problems with acrobat plugin and its "Fast Web View" feature.
+- Show records sorted on descending datestamp, instead of ascending record id,
+  in sqlite backend.
+
+Changes
+~~~~~~~
+
 MOAI 1.0.10 (2010-03-25)
 ------------------------
 
 
 setup(
     name='MOAI',
-    version='1.0.11dev',
+    version='1.1.0',
     author='Infrae',
     author_email='jasper@infrae.com',
     url='http://moai.infrae.com',

File src/moai/database/sqlite.py

             until_date = datetime.datetime.now()
 
 
-        query = self.records.select(sql.and_(self.records.c.is_set == False,
-                                             self.records.c.is_asset == False))
+        query = self.records.select(
+            sql.and_(self.records.c.is_set == False,
+                     self.records.c.is_asset == False),
+            order_by = [sql.desc(self.records.c.when_modified)])
 
         # filter dates
         query.append_whereclause(self.records.c.when_modified <= until_date)

File src/moai/http/apache.py

         """Send the file located at 'path' back to the user
         """
         self.req.content_type = mimetype
+        self.req.headers_out['Accept-Ranges'] = 'none'
         self.req.sendfile(path)
         return apache.OK
     

File src/moai/interfaces.py

     sets_disallowed = Attribute(
         u"Objects served must not have one of these sets")
     filter_sets = Attribute(
-        u"Objects served must have one of these sets, besides the"
+        u"Objects served must have one of these sets, besides the "
         "conforming to the (dis-)allowed sets")
+    sets_deleted = Attribute(
+        u"Records in this set will always be served as deleted OAI records "
+        "this can be used as an alternative to sets_dissallowed.")
     delay = Attribute(u"number of miliseconds to delay the feed")
 
 

File src/moai/oai.py

         datestamp = record['record']['when_modified']
         sets = [self.config.get_setspec_id(s) for s in record['sets']]
         deleted = record['record']['deleted']
+        for deleted_set in self.config.sets_deleted:
+            if deleted_set in record['sets']:
+                deleted = True
+                break
         return oaipmh.common.Header(oai_id, datestamp, sets, deleted)
 
     def _createHeaderAndMetadata(self, record):

File src/moai/server.py

                  content_type = None,
                  sets_allowed = [],
                  sets_disallowed = [],
+                 sets_deleted = [],
                  filter_sets = [],
                  delay = 0,
                  base_asset_path=None):
         self.content_type = content_type
         self.sets_allowed = sets_allowed
         self.sets_disallowed = sets_disallowed
+        self.sets_deleted = sets_deleted
         self.filter_sets = filter_sets
         self.delay = delay
         self.base_asset_path = base_asset_path or tempfile.gettempdir()

File src/moai/tests/test_oai.py

                                 metadataPrefix=u'oai_dc')
         self.assertTrue('code="idDoesNotExist"' in response)
 
-    def test_disallowed_record(self):
+    def test_disallowed_set_record(self):
         config = FeedConfig('test', 'A test Repository',
                             'http://localhost/repo/test',
                             logging,
                                 metadataPrefix=u'oai_dc')
         self.assertTrue('<error code="idDoesNotExist">oai:id:2</error>' in response)
 
+    def test_deleted_set_record(self):
+        config = FeedConfig('test', 'A test Repository',
+                            'http://localhost/repo/test',
+                            logging,
+                            sets_deleted=[u'datasets'])
+        self.server = Server('http://localhost/repo', self.db)
+        self.server.add_config(config)
+        # identifier 2 should be in the identifier list
+        response = self.request(verb=u'ListIdentifiers', metadataPrefix=u'oai_dc')
+        self.assertTrue('<identifier>oai:id:2</identifier>' in response)
+        response = self.request(verb=u'GetRecord', identifier=u'oai:id:2',
+                                metadataPrefix=u'oai_dc')
+        self.assertTrue('<header status="deleted">' in response)
+        self.assertFalse('<metadata>' in response)
 
 class OAISQLiteTest(OAIBtreeTest):