changeset 46:955d102392db

pubman integration 0.2
author dwinter
date Sat, 27 Apr 2013 10:04:57 +0200
parents 3c98cc79dd14
children 225179dfd892
files MPIWGStaff.py zpt/staff/member_index_html.zpt
diffstat 2 files changed, 23 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGStaff.py	Fri Apr 26 19:09:50 2013 +0200
+++ b/MPIWGStaff.py	Sat Apr 27 10:04:57 2013 +0200
@@ -1120,10 +1120,12 @@
         
         return tmp
     
-    def getPublications(self,memberID="renn"):
+    def getPublications(self,coneId="renn"):
         
+        logging.debug("coneID:%s"%coneId)
         try:
-            pubs=self.mpiwgPubman.getPublications(memberID)
+            pubs=self.mpiwgPubman.getPublications(coneId)
+            
             return pubs
         except:
             return []
@@ -1165,6 +1167,13 @@
         id = re.sub('@mpiwg-berlin\.mpg\.de', '', self.content.e_mail)
         return id
     
+    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
+    
     def getPublishedImageUrl(self):
         """returns the URL to the image if it is published"""
         if self.content.image_p == 'yes':
@@ -1556,9 +1565,11 @@
         
     def getPublications(self):
         
-        pubs= self.folder.getPublications("")
-       
-        return pubs
+        coneId = self.getConeId();
+        if coneId:
+            pubs= self.folder.getPublications(coneId)
+            return pubs
+        return []
         
         
 InitializeClass(MPIWGStaffMember) 
--- a/zpt/staff/member_index_html.zpt	Fri Apr 26 19:09:50 2013 +0200
+++ b/zpt/staff/member_index_html.zpt	Sat Apr 27 10:04:57 2013 +0200
@@ -61,6 +61,11 @@
       <p tal:condition="python:len(publications)>5">
         <a class="internal" tal:attributes="href string:$baseUrl/publications_full">more</a>
       </p>
+      <p>
+      <a target="_blank"
+          tal:attributes="href python:member.getConeId()">
+          See all publications (pubman)</a>
+       </p>
     </tal:block>
     <!-- Talks -->
     <tal:block tal:define="talks python:here.ZDBInlineSearch(_table='talks',key_main=key,_op_key_main='eq',_sort='priority',published='yes')"
@@ -159,8 +164,8 @@
       </div>
       <div class="item internal">
         <a target="_blank"
-          tal:attributes="href python:'http://edoc.mpg.de/display.epl?nmbF=2&nmbK=9&cntDate=5&allType=1&moreFields=less&field1=all&field2=persons&persType2=all&personValue2=%s&wts=arc&scol=11&smode=AND&phrase=similar&nohp=10&outfor=bib&mode=admSearch'%content.last_name">
-          See publications on Edoc-Server</a>
+          tal:attributes="href python:member.getConeId()">
+          See publications on pubman</a>
       </div>
       <div class="item internal"
         tal:repeat="addLink python:here.ZDBInlineSearch(_table='additionallink',key_main=key,_op_key_main='eq',_sort='priority',published='yes')">