Changeset 4556


Ignore:
Timestamp:
08/12/08 09:30:55 (11 years ago)
Author:
cbyrom
Message:

Clear out problems with the upload of granulite data workflow.

Location:
MILK/trunk/milk_server/milk_server/controllers/atom_editor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/editatom.py

    r4535 r4556  
    2121from ndgUtils.eXistConnector import eXistConnector 
    2222from ndgUtils.lib.atomvalidator import ValidationError 
    23 import ndgUtils.models.existdbclient as edc 
     23import ndgUtils.lib.existdbclient as edc 
    2424from ndgUtils.models.MolesEntity import MolesEntity as ME 
    2525from ndgUtils.lib.utilities import escapeSpecialCharacters 
     
    104104        ''' 
    105105        logging.info("Uploading file...") 
     106        self.__setup(uri=uri) 
    106107        if uri: 
    107108            file = request.POST.get('upload_CSML') 
     
    123124                    self.prepareDataModel(uri) 
    124125                else: 
    125                     self.__setup() 
    126126                    c.atom = Atom() 
    127127 
     
    129129                if uri: 
    130130                    self.__processCSMLFile(file) 
     131 
     132                    # save new data - NB, for granulites, this is done as part of the 
     133                    # processing steps 
     134                    self.saveAtomToExist(c.atom) 
    131135                else: 
    132136                    self.__processGranuliteFile(file.value) 
    133  
    134                 # save new data 
    135                 self.saveAtomToExist(c.atom) 
     137                    # Now set up the ndgObject with the created atom's vals 
     138                    self.__setup(uri=c.atom.ndgURI) 
     139                    c.atom.ndgObject = self.ndgObject 
     140                 
    136141                             
    137142                # now do redirection - NB, this ensures that current atom contents are 
     
    142147            self.__unpackErrors(e) 
    143148 
    144         if uri and c.atom: 
     149        if c.atom and hasattr(c.atom, 'ndgURI'): 
    145150            self.pathInfo = self.pathInfo.replace('upload', 'editAtom') 
    146151            return self.edit(c.atom.ndgURI) 
     
    171176 
    172177     
    173  
    174178    def __processGranuliteFile(self, fileContents): 
    175179        ''' 
     
    325329        except SystemError, e: 
    326330            return self.__handleError(e) 
    327  
    328         c.title='Editing [%s]'%self.ndgObject 
     331             
     332        c.title='Editing [%s]' %c.atom.ndgURI 
    329333        c.uri = c.atom.ndgURI 
    330334         
     
    391395 
    392396        except Exception, e: 
    393             #we may be showing an xml document ... but it could go wrong if 
    394             #we have crap content ... 
     397            errorMessage = traceback.format_exc() 
    395398            c.xml='Unexpected error [%s] viewing [%s]'%(str(e), uri) 
    396399            c.doc='' 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/listatom.py

    r4535 r4556  
    1111from ndgUtils import DocumentRetrieve 
    1212from ndgUtils.eXistInterface import ndg_eXist 
    13 import ndgUtils.models.existdbclient as edc 
     13import ndgUtils.lib.existdbclient as edc 
    1414from ndgUtils.models.MolesEntity import MolesEntity as ME 
    1515from ndgUtils.vocabtermdata import VocabTermData as VTD, VocabTermItem as VTI 
     
    159159                              pwfile=self.cf.get('NDG_EXIST','passwordFile')) 
    160160         
    161         # NB, for some reason, this sometimes results in a spurious  
     161        # NB, for some reason, the xmlrpc call to eXist sometimes results in a spurious  
    162162        # 'java.lang.IndexOutOfBoundsException' - retry a couple of times, if so 
    163163        attempt = 0 
Note: See TracChangeset for help on using the changeset viewer.