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

def CMFBibliographyAT::content::folder::BaseBibliographyFolder::processImport (   self,
  format = None,
  return_obs = False 
) [inherited]

main routine to be called for importing entire files 

Definition at line 176 of file folder.py.

00176                                                                             :
        """ main routine to be called for importing entire files """
        # XXX This method does not seem to be called! skins/bibliography_import.cpy
        # is used instead, so far as I can tell.  We should probably remove
        # this method, or clarify things to some extent.

        # get parsed entries from the Bibliography Tool
        bibtool = getToolByName(self, 'portal_bibliography')
        entries = bibtool.getEntries(source, format, filename)

        # start building the report
        mtool  = getToolByName(self, 'portal_membership')
        member = mtool.getAuthenticatedMember()
        member_id = member.getId()
        fullname = member.getProperty('fullname', None)
        if not fullname:
            fullname = 'unknown fullname'
        import_date = self.ZopeTime()
        tmp_report = '[%s] Imported by %s (%s) from file %s:\n\n' \
                     %(import_date, member_id, fullname, filename)

        # process import for each entry
        obs = []
        for entry in entries:
            if entry.get('title'):
                if return_obs:
                    upload = self.processSingleImport(entry, return_ob=True)
                    upload = self.processSingleImport(entry)
                tmp_report = tmp_report + upload[0]

        # finish building and write the report
        old_report = self.import_report
        report = tmp_report \
               + '='*30 + '\n' \
               + old_report

        if return_obs:
            return obs
        return None

    def cookId(self, ref):

Generated by  Doxygen 1.6.0   Back to index