comparison MPIWGStaff.py @ 141:45b7b24c8c42

move getPublicationsFromPubman to MPIWGStaffMember.
author casties
date Fri, 31 May 2013 17:56:46 +0200
parents 9f45ed6ffeab
children 6ae0201b1257
comparison
equal deleted inserted replaced
140:f84f492f8e11 141:45b7b24c8c42
16 import email 16 import email
17 import re 17 import re
18 18
19 from Products.ZDBInterface.ZDBInterfaceFolder import ZDBInterfaceFolder 19 from Products.ZDBInterface.ZDBInterfaceFolder import ZDBInterfaceFolder
20 20
21 from SrvTxtUtils import getHttpData, getAt, getInt, unicodify, utf8ify 21 from SrvTxtUtils import getInt, unicodify, utf8ify
22 import MPIWGHelper 22 import MPIWGHelper
23 23
24 # 24 #
25 # compatibility 25 # compatibility
26 # TODO: should be removed when done 26 # TODO: should be removed when done
185 tmp.sort(sort) 185 tmp.sort(sort)
186 186
187 return tmp 187 return tmp
188 188
189 189
190 def getPublicationsFromPubman(self,coneId="renn",limit=None,publicationType=None):
191
192 logging.debug("coneID:%s"%coneId)
193 try:
194 pubs=self.mpiwgPubman.getPublications(coneId,limit=limit,publicationType=publicationType)
195
196 return pubs
197 except:
198 return []
199
200
201 def importSortingModeFromOldStaff(self): 190 def importSortingModeFromOldStaff(self):
202 """ only used for the migration to the new website """ 191 """ only used for the migration to the new website """
203 ret=[] 192 ret=[]
204 for member in self.getMemberList(): 193 for member in self.getMemberList():
205 email = member.content.e_mail 194 email = member.content.e_mail
724 713
725 # TODO: compat, is this used? 714 # TODO: compat, is this used?
726 getStaffURL = getUsername 715 getStaffURL = getUsername
727 716
728 def getPublicationsFromPubman(self,limit=None,publicationType=None): 717 def getPublicationsFromPubman(self,limit=None,publicationType=None):
729 718 """Return list of publications."""
730 719
731 if self.content.publications_mode=="year": 720 if self.content.publications_mode=="year":
732 coneId = self.getConeId(); 721 coneId = self.getConeId();
733 if coneId: 722 if coneId:
734 pubs= self.folder.getPublicationsFromPubman(coneId,limit=limit,publicationType=publicationType) 723 pubs = self.folder.mpiwgPubman.getPublications(coneId,limit=limit,publicationType=publicationType)
724 #pubs= self.folder.getPublicationsFromPubman(coneId,limit=limit,publicationType=publicationType)
735 return pubs 725 return pubs
736 726
737 elif self.content.publications_mode=="priority": 727 elif self.content.publications_mode=="priority":
738 selPubs= self.getSelectedPublications() 728 selPubs= self.getSelectedPublications()
739 729
749 739
750 #TODO getEntryFromPubmanShould return long texts 740 #TODO getEntryFromPubmanShould return long texts
751 typesLongShort={'http://purl.org/eprint/type/Book':'book', 741 typesLongShort={'http://purl.org/eprint/type/Book':'book',
752 'http://purl.org/eprint/type/BookItem':'book-item', 742 'http://purl.org/eprint/type/BookItem':'book-item',
753 'http://purl.org/escidoc/metadata/ves/publication-types/article':'article'}; 743 'http://purl.org/escidoc/metadata/ves/publication-types/article':'article'};
754
755
756
757
758 744
759 if publicationType is not None: #publicaitions typ ist gesetzt 745 if publicationType is not None: #publicaitions typ ist gesetzt
760 746
761 if not ((entry[1] == publicationType) or (entry[1] == typesLongShort.get(publicationType,''))) : #stimmt nicht dann weiter 747 if not ((entry[1] == publicationType) or (entry[1] == typesLongShort.get(publicationType,''))) : #stimmt nicht dann weiter
762 continue; 748 continue;