--- MPIWGWeb/Attic/MPIWGRoot.py 2010/06/23 15:01:56 1.1.2.27 +++ MPIWGWeb/Attic/MPIWGRoot.py 2010/09/22 16:06:09 1.1.2.29 @@ -67,6 +67,17 @@ class MPIWGRoot(ZSQLExtendFolder): # types of objects that show up in navigation nav_meta_types = ['MPIWGTemplate','MPIWGLink','MPIWGFolder'] + manage_options = Folder.manage_options+( + {'label':'Update personal homepages','action':'updatePersonalwww_html'}, + {'label':'Reindex catalogs','action':'reindexCatalogs'}, + {'label':'Main config','action':'changeMPIWGRootForm'}, + {'label':'add e-mails','action':'showNewDBEntries'}, + #{'label':'update the institutsbibliography','action':'updateInstitutsbiliography'}, + #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'}, + #{'label':'Store Historical Persons','action':'storeHistoricalPersons'}, + ) + + def getGetNeighbourhood(self,obj, wordStr, length=100,tagging=True): """finde umgebung um die worte in wordStr, zurueckgegeben wird eine Array mit den Umgebungen von Fundstellen der Worte alle Tags werden entfernt, die Fundstellen werden mit XX getaggt, die Umgebungen werden @@ -683,17 +694,6 @@ class MPIWGRoot(ZSQLExtendFolder): return projects - manage_options = Folder.manage_options+( - {'label':'Update personal homepages','action':'updatePersonalwww_html'}, - {'label':'Reindex catalogs','action':'reindexCatalogs'}, - {'label':'Main config','action':'changeMPIWGRootForm'}, - {'label':'add e-mails','action':'showNewDBEntries'}, - {'label':'update the institutsbibliography','action':'updateInstitutsbiliography'}, - #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'}, - #{'label':'Store Historical Persons','action':'storeHistoricalPersons'}, - ) - - def updatePublicationDB(self,personId=None): """updates the publication db, i.e. copy year and type into the main table""" @@ -786,10 +786,13 @@ class MPIWGRoot(ZSQLExtendFolder): return result,msg - def updatePersonEntry(self,data,ignoreEntries=[]): + def updatePersonEntry(self,data,ignoreEntries=None): """update an person entry from data. but ignore all fields in ignore Entries""" - + if ignoreEntries is None: + ignoreEntries = [] + ignoreEntries.append('current_work') # TODO:updatecurrent work + logging.debug("updatePersonEntry: data=%s ignoreEntries=%s"%(repr(data),repr(ignoreEntries))) if data['date_to']=="": # wenn date_to leer data['date_to']="date_none" @@ -803,9 +806,9 @@ class MPIWGRoot(ZSQLExtendFolder): columns=data.keys() for x in ignoreEntries: - logging.info("ign rem: %s"%x) + logging.debug("updatePersonEntry: ignoring %s"%x) try: #falls in ignore entries felder sind, die nicht in columns sind, fange den fehler ab - columns.remove(x) + columns.remove(x) except: pass @@ -837,6 +840,8 @@ class MPIWGRoot(ZSQLExtendFolder): resultSet=self.REQUEST.SESSION['personal_www']['resultSet'] news=self.REQUEST.SESSION['personal_www']['news'] conflicts=self.REQUEST.SESSION['personal_www']['conflicts'] + logging.debug("updatePersonalwww_doIt: args=%s\n resultSet=%s\n news=%s\n conflicts=%s"%(args,resultSet,news,conflicts)) + ret="" # generate the new entry @@ -844,8 +849,8 @@ class MPIWGRoot(ZSQLExtendFolder): ret+="

Hinzugefügt

" ret+="

Neueinträge erscheinen erst auf der Homepage, wenn ihnen eine e-mail Adresse zugeordnet wurde.

" ret+="" @@ -871,9 +877,9 @@ class MPIWGRoot(ZSQLExtendFolder): if args[conflict.encode('utf-8')+'_'+cf[0]]=="stored": #use the stored one ignoreEntries.append(cf[0]) #so ignore field cf[0] displayIgnored.append(cf) + if len(displayIgnored)>0: ret+="

%s

"%conflict.encode('utf-8') - ret+="" for iE in displayIgnored: ret+=""%(iE[0].encode('utf-8'),iE[1].encode('utf-8'),iE[2].encode('utf-8'))
%s%s%s