changeset 282:d83971b49b26

added updateConeIds changed getConeIds, so dass diese erzeugt werden falls sie fehlen.
author dwinter
date Thu, 21 May 2015 09:22:11 +0200
parents 3f9ba7a8cb27
children 37b89e8a8828
files MPIWGStaff.py
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGStaff.py	Wed Oct 08 15:18:19 2014 +0200
+++ b/MPIWGStaff.py	Thu May 21 09:22:11 2015 +0200
@@ -306,6 +306,17 @@
         return ret+"</body></html>"
 
 
+
+    def updateConeIds(self,REQUEST):
+        """holt alle coneids von allen member, die methode getconeid traegt diese dann auch all in die key tabelle ein, falls sie ich fehlen"""
+
+        mems= self.getMemberList()
+        cids=[]
+        for mem in mems:
+            cids.append(mem.getConeId())
+
+        return cids
+
     def getConeIDsFromDB(self,REQUEST):
         """holt die cone ids aus personalwww und gibt sie als RDF fuer den cone import zurueck"""
         
@@ -404,13 +415,20 @@
     
     getId = getUsername
     
+
+    
     def getConeId(self):
         """return cone ID"""
         results= self.folder.executeZSQL("SELECT coneid FROM keys WHERE key_main = %s",[self.content.key]) 
         for res in results:
             return res.coneid
-        return None
-    
+
+        newConeId="http://pubman.mpiwg-berlin.mpg.de/cone/persons/resource/%s"%self.content.key
+        
+        results = self.folder.executeZSQL("INSERT  INTO keys (coneid,key_main) values(%s,%s)",[newConeId,self.content.key]) 
+        
+        return newConeId
+ 
     def getPublishedImageUrl(self, width=None, height=None, showAlways=False):
         """returns the URL to the image if it is published"""
         if self.content.image_p == 'yes' or showAlways: