Logo Search packages:      
Sourcecode: zope-cmfbibliographyat version File versions  Download package

def CMFBibliographyAT::content::folder::BaseBibliographyFolder::processSingleImport (   self,
  entry,
  infer_references = True 
) [inherited]

called for importing a single entry 

Definition at line 142 of file folder.py.

00142                                                                :
        """ called for importing a single entry """
        url = None
        relations = None
        if isinstance(entry, EntryParseError):
            return ('Failed: %s' % entry.description, 'FAILED')
        obj = None
        try:
            newid = self.cookId(entry)
            if newid and newid != "nobody1000":
                type = entry.get('publication_type', 'ArticleReference')
                if type in self.allowed_content_types:
                    self.invokeFactory(type, newid)
                    obj = getattr(self, newid)
                    obj.edit(**entry)
                    url = obj.absolute_url()
                    if obj.usesCMFMember() and infer_references:
                        relations = obj.inferAuthorReferences()
            import_status = 'ok'
        except: # for debugging
            # Remove the \n from import_status so that it all appears
            # on one line in the import_report, which keeps the count
            # the same as that reported.
            import_status = "Error type: %s. Error value: %s" \
                          % (sys.exc_info()[0],
                             sys.exc_info()[1])

        report_line = self.buildReportLine(import_status,
                                           entry,
                                           url=url,
                                           relations=relations)
        return (report_line, import_status, obj)

    security.declareProtected(AddPortalContent, 'processImport')
    def processImport(self, source, filename, format=None, return_obs=False):


Generated by  Doxygen 1.6.0   Back to index