Ignore:
Timestamp:
16/02/09 17:16:00 (12 years ago)
Author:
cbyrom
Message:

Add new trackback controller and implement methods to allow
authenticated users to post comments on metadata docs. These comments
are then emailed to the metadata maintainer and added to the
corrections feed. Control then returns to the metadata document - in
non edit form - and, in the case of moles atom docs, a pop up informs
the user that the operation has completed successfully. Also add the
required genshi templates and template methods to enable this new
functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/retrieve.py

    r4959 r4984  
    55from milk_server.lib.base import * 
    66from milk_server.lib import Utilities 
    7 from milk_server.lib import mailer 
    87from milk_server.lib.ndgInterface import ndgInterface  
    98from ndg.common.src.lib.ETxmlView import et2text, et2html 
     
    3938        if 'outputSchema' in self.inputs:  
    4039            self.outputSchema=self.inputs['outputSchema'] 
    41  
    42         # Add selected granules to context 
    43         #c.selectedGranules = [g_uri for g_uri, g_name in session.get('selection', [])] 
    4440                               
    4541        logging.info("RetrieveController set up") 
     
    272268            logging.error(c.xml) 
    273269            return render('error') 
    274      
    275     def askCorrect(self,uri): 
    276         ''' Provide a form (ajaxaciously) so that a user can correct a metadata record''' 
    277         status=self.__setup(uri) 
    278         c.uri=self.uri 
    279         if status: return response.write(status) 
    280         return render('correct',fragment=True) 
    281  
    282      
    283     def correct(self,uri): 
    284         ''' Receive a correction form to update a record and post it to the holder ''' 
    285         status=self.__setup(uri) 
    286         if 'ndgSec' not in session: 
    287             return response.write('Not Logged In') 
    288         body='Metadata Change Request for %s'%uri 
    289         payload='<Change><uri>%s</uri><from>%s</from><Contents>%s</Contents></Change>'%( 
    290             self.inputs['Identifier'],self.inputs['Submitter'],self.inputs['Comment']) 
    291         name='ChangeRequestFor_%s.xml'%uri 
    292         status,message=mailer.mailHandler([self.cf.get('DEFAULT','metadataMaintainer'),], 
    293                        body,body,xmlAttachments=[(payload,name),], 
    294                        server=self.cf.get('DEFAULT','mailserver')) 
    295         if status: 
    296             c.xml='<p>Success: Mail sent to metadata maintainer</p>' 
    297         else: 
    298             c.xml=message 
    299         return render('content') 
Note: See TracChangeset for help on using the changeset viewer.