Mercurial > hg > ZopePubmanConnector
annotate zopePubmanConnector.py @ 16:3e154b154b6f
timeouts
author | dwinter |
---|---|
date | Fri, 14 Jun 2013 12:27:01 +0200 |
parents | ca3084877394 |
children | 48c4a6f3b135 |
rev | line source |
---|---|
0 | 1 # -*- coding: utf-8 -*- |
2 | |
3 #Verbindet Zope mit pubman. | |
4 | |
5 | |
6 from OFS.SimpleItem import SimpleItem | |
7 from Products.PageTemplates.PageTemplateFile import PageTemplateFile | |
8 import os.path | |
9 | |
10 from Globals import package_home | |
11 import httplib2 | |
12 import xml.etree.ElementTree as ET | |
1 | 13 import logging |
9 | 14 import time |
10 | 15 import unicodedata |
6 | 16 |
16 | 17 TIMEOUT=10 |
18 | |
6 | 19 cacheFolder ="/var/tmp/.cacheWWW" |
20 | |
14 | 21 ns = {'escidocMetadataProfile':"http://escidoc.mpg.de/metadataprofile/schema/0.1/", |
22 'escidocMetadataRecords':"http://www.escidoc.de/schemas/metadatarecords/0.4", | |
23 'dc':'http://purl.org/dc/elements/1.1/', | |
24 'escidocComponents':'http://www.escidoc.de/schemas/components/0.8', | |
25 'escidocItem':'http://www.escidoc.de/schemas/item/0.8' | |
26 } | |
27 | |
28 | |
29 | |
0 | 30 def zptFile(self, path, orphaned=False): |
31 """returns a page template file from the product""" | |
32 if orphaned: | |
33 # unusual case | |
34 pt=PageTemplateFile(os.path.join(package_home(globals()), path)) | |
35 else: | |
36 | |
37 pt=PageTemplateFile(os.path.join(package_home(globals()), path)).__of__(self) | |
38 return pt | |
39 | |
40 class ZopePubmanConnector(SimpleItem): | |
41 | |
42 | |
43 connectorString="http://pubman.mpiwg-berlin.mpg.de/search/SearchAndExport?" | |
44 | |
45 | |
46 meta_type="ZopePubmanConnector" | |
47 | |
48 manage_options= ({'label':'Main Config','action': 'changeMain'},) + SimpleItem.manage_options | |
49 | |
50 def __init__(self,id,title,pubmanURL): | |
51 self.id=id | |
52 self.title=title | |
53 self.pubmanURL=pubmanURL #URL einer pubman instance bzw. einer collection, falls nicht die default collection benutzt werden soll | |
54 | |
55 | |
56 | |
57 def changeMain(self,pubmanURL=None,title=None,REQUEST=None,RESPONSE=None): | |
58 """change main settings""" | |
59 if pubmanURL: | |
60 self.pubmanURL=pubmanURL | |
61 self.title=title | |
62 | |
63 if RESPONSE is not None: | |
64 RESPONSE.redirect('manage_main') | |
65 | |
66 | |
67 else: | |
68 pt=zptFile(self, 'zpt/ChangeZopePubmanConnector.zpt') | |
69 return pt() | |
70 | |
71 | |
2 | 72 def getPublications(self,personID,limit=None,publicationType=None): |
0 | 73 """get all publications der personID""" |
16 | 74 h = httplib2.Http(cacheFolder,timeout=TIMEOUT) |
1 | 75 |
76 | |
2 | 77 |
78 if publicationType is None: | |
11 | 79 # cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22&" |
80 cn = self.connectorString+"cqlQuery=escidoc.publication.creator.person.identifier=%22"+personID+"%22&" | |
2 | 81 else: |
11 | 82 #cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22" |
13
43849c9cc08b
Incomplete - # 74: More Link auf den pers?nlichne Homepages
dwinter
parents:
12
diff
changeset
|
83 cn = self.connectorString+"cqlQuery=%28escidoc.publication.creator.person.identifier=%22"+personID+"%22%29" |
43849c9cc08b
Incomplete - # 74: More Link auf den pers?nlichne Homepages
dwinter
parents:
12
diff
changeset
|
84 cn +="%20and%28%20escidoc.publication.type=%22"+publicationType+"%22%29&" |
2 | 85 |
86 cn +="exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" | |
87 if limit: | |
88 cn+="&maximumRecords=%s"%limit | |
1 | 89 |
2 | 90 logging.debug(cn) |
91 resp, content = h.request(cn) | |
92 | |
3 | 93 |
2 | 94 |
0 | 95 ET.register_namespace("dcterms", "http://purl.org/dc/terms/") |
96 | |
97 root = ET.fromstring(content) | |
98 | |
2 | 99 #<escidocItem:item objid="escidoc:630782" |
100 | |
0 | 101 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" |
102 | |
2 | 103 objxpath=".//{http://www.escidoc.de/schemas/item/0.8}item" |
14 | 104 |
105 | |
106 | |
2 | 107 citations=root.findall(objxpath) |
14 | 108 logging.debug(len(citations)) |
0 | 109 ret=[] |
110 for citation in citations: | |
2 | 111 objId = citation.get('objid') |
14 | 112 |
2 | 113 text = citation.find(citationxpath) |
114 | |
14 | 115 |
116 | |
117 | |
118 | |
119 idTermPath =""".//escidocMetadataRecords:md-records/escidocMetadataRecords:md-record/escidocMetadataProfile:publication/dc:identifier""" | |
120 #idTermPath =".//{http://purl.org/dc/elements/1.1/}identifier" | |
121 | |
122 idterms = citation.findall(idTermPath,ns) | |
123 | |
124 linksIdentifier=[] | |
125 linksLocator=[] | |
126 | |
127 | |
128 bookID = None | |
129 | |
130 | |
131 for idterm in idterms: | |
132 if idterm.get("{http://www.w3.org/2001/XMLSchema-instance}type",'') in ['eterms:OTHER','eidt:OTHER']: ##suche nach bookID | |
133 logging.debug("zopePubmanConnector: %s"%idterm.text) | |
134 checkID =idterm.text.lstrip().rstrip() | |
135 if checkID.startswith("MPIWG-Book:"): | |
136 bookID = checkID | |
137 break | |
138 elif idterm.get("{http://www.w3.org/2001/XMLSchema-instance}type",'') in ['eterms:URI','eidt:URI']: | |
139 linksIdentifier.append(idterm.text.lstrip().rstrip()) | |
140 | |
141 | |
142 | |
143 | |
144 componentsPath =""".//escidocComponents:components[1]""" | |
145 | |
146 components=citation.findall(componentsPath,ns); | |
147 | |
148 for component in components: | |
149 cnt = component.find(".//escidocComponents:content",ns) | |
150 if cnt is not None: | |
151 link="" | |
152 title="" | |
153 type="" | |
154 for name,value in cnt.items(): | |
155 if name.endswith("href"): | |
156 link=value | |
157 elif name.endswith("title"): | |
158 title=value | |
159 elif name.endswith("storage"): | |
160 type=value | |
161 | |
162 linksLocator.append((title,link,type)) | |
163 | |
164 | |
165 | |
166 | |
167 ret.append((objId,text.text,bookID,linksIdentifier,linksLocator)) | |
0 | 168 |
169 | |
170 | |
171 return ret | |
172 | |
2 | 173 |
5 | 174 def search(self,values={},exact=False,limit=None,contexts=None): |
2 | 175 """search pubman |
176 @values map mit field->value | |
177 @return map mit escidocId -> XML-formatted snippeds | |
178 """ | |
179 | |
180 fieldToEscidoc={"title":"escidoc.any-title", | |
181 "author":"escidoc.publication.any.publication-creator-names", | |
10 | 182 "any":"escidoc.metadata"} |
2 | 183 |
184 | |
185 cn = self.connectorString+"cqlQuery=%s&" | |
186 cn +="exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" | |
187 | |
5 | 188 if limit: |
189 cn+="&maximumRecords=%s"%limit | |
2 | 190 |
191 querys = [] | |
192 for field in values.keys(): | |
193 | |
194 searchField = fieldToEscidoc.get(field,None) | |
195 if searchField is None: | |
196 logging.debug("search, don't know field: %s"%field) | |
197 continue | |
198 | |
199 value = values[field] | |
10 | 200 try: |
201 value=unicodedata.normalize('NFKD', value).encode('ASCII', 'ignore') | |
202 except: | |
203 value=unicodedata.normalize('NFKD', value.decode('utf-8')).encode('ASCII', 'ignore') | |
2 | 204 if value == '': |
205 continue | |
206 logging.debug("%s=%s"%(field,value)) | |
207 if not exact: | |
208 value=value+"*" | |
209 | |
210 querys.append("%s=%%22%s%%22"%(searchField,value)) | |
211 | |
10 | 212 query="%20AND%20".join(querys) |
5 | 213 |
214 if contexts: # einscbraenken auf contexte | |
215 | |
216 if isinstance(contexts, str): | |
217 contexts=[contexts] | |
218 | |
219 ctxquerys=[] | |
220 for context in contexts: | |
221 ctxquerys.append("escidoc.context.objid=%%22%s%%22"%(context)) | |
222 | |
10 | 223 ctxquery="%20OR%20".join(ctxquerys) |
5 | 224 |
225 if query!="": | |
10 | 226 query=query+"AND%%20(%s)"%ctxquery |
5 | 227 else: |
228 query="(%s)"%ctxquery | |
229 | |
12 | 230 try: |
16 | 231 h = httplib2.Http(cacheFolder,timeout=TIMEOUT) |
12 | 232 logging.debug("search: "+cn%query) |
233 resp, content = h.request(cn%query) | |
234 except: | |
235 logging.error("Unable to get data from PubMan!") | |
236 return {} | |
2 | 237 |
238 ET.register_namespace("dcterms", "http://purl.org/dc/terms/") | |
239 | |
3 | 240 try: |
241 root = ET.fromstring(content) | |
242 except: | |
243 logging.error("Couldn't parse content of:%s"%(cn%query)) | |
244 return {} | |
2 | 245 #<escidocItem:item objid="escidoc:630782" |
246 | |
247 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" | |
248 | |
249 objxpath=".//{http://www.escidoc.de/schemas/item/0.8}item" | |
250 citations=root.findall(objxpath) | |
251 | |
252 ret={} | |
253 for citation in citations: | |
254 objId = citation.get('objid') | |
255 text = citation.find(citationxpath) | |
256 ret[objId]=text.text | |
257 | |
258 return ret | |
259 | |
11 | 260 |
261 def getEntriesFromPubman(self,escidocids): | |
2 | 262 |
11 | 263 doctypes={} |
264 for escidocid in escidocids: | |
265 | |
15 | 266 txt, type, bookID,linksIdentifier,linksLocator = self.getEntryFromPubman(escidocid.escidocid, True) |
11 | 267 |
268 if not doctypes.has_key(type): | |
269 doctypes[type]=[] | |
15 | 270 |
271 entry={} | |
272 entry['citation']= txt | |
273 entry['escidocId']= escidocid.escidocid | |
274 entry['bookId']=bookID | |
275 entry['linksIdentifier']=linksIdentifier | |
276 entry['linksLocator']=linksIdentifier | |
277 doctypes[type].append(entry) | |
11 | 278 |
279 | |
280 return doctypes | |
281 | |
282 | |
283 def getEntryFromPubman(self,escidocid,extendedData=None): | |
4 | 284 """get one entry""" |
285 | |
14 | 286 |
287 | |
3 | 288 escidocid=escidocid.lstrip().strip() |
16 | 289 h = httplib2.Http(cacheFolder,timout=TIMEOUT) |
2 | 290 cn = self.connectorString+"cqlQuery=escidoc.objid=%s&" |
291 cn +="exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" | |
292 | |
293 resp, content = h.request(cn%escidocid) | |
294 ET.register_namespace("dcterms", "http://purl.org/dc/terms/") | |
3 | 295 logging.debug(cn%escidocid) |
4 | 296 |
2 | 297 root = ET.fromstring(content) |
298 | |
299 | |
300 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" | |
301 | |
14 | 302 itempath = ".//escidocItem:item" |
303 | |
304 item = root.find(itempath,ns) #get item | |
305 | |
306 citation=item.find(citationxpath,ns) | |
307 | |
308 | |
309 if citation is not None and extendedData is not None: | |
310 | |
311 linksIdentifier=[] | |
312 linksLocator=[] | |
313 | |
2 | 314 |
11 | 315 |
14 | 316 #get identifier |
317 idTermPath =""".//escidocMetadataRecords:md-records/escidocMetadataRecords:md-record/escidocMetadataProfile:publication/dc:identifier""" | |
318 #idTermPath =".//{http://purl.org/dc/elements/1.1/}identifier" | |
319 | |
320 idterms = item.findall(idTermPath,ns) | |
321 | |
322 bookID = None | |
323 logging.debug("zopePubmanConnector: %s"%idterms) | |
324 for idterm in idterms: | |
325 | |
326 if idterm.get("{http://www.w3.org/2001/XMLSchema-instance}type",'') in ['eterms:OTHER','eidt:OTHER']: ##suche nach bookID | |
327 logging.debug("zopePubmanConnector: %s"%idterm.text) | |
328 checkID =idterm.text.lstrip().rstrip() | |
329 if checkID.startswith("MPIWG-Book:"): | |
330 bookID = checkID | |
331 break | |
332 elif idterm.get("{http://www.w3.org/2001/XMLSchema-instance}type",'') in ['eterms:URI','eidt:URI']: | |
333 linksIdentifier.append(idterm.text.lstrip().rstrip()) | |
334 | |
335 | |
336 #get files and locators | |
337 componentsPath =""".//escidocComponents:components[1]""" | |
338 | |
339 components=item.findall(componentsPath,ns); | |
340 | |
341 for component in components: | |
342 cnt = component.find(".//escidocComponents:content",ns) | |
343 if cnt is not None: | |
344 link="" | |
345 title="" | |
346 type="" | |
347 for name,value in cnt.items(): | |
348 if name.endswith("href"): | |
349 link=value | |
350 elif name.endswith("title"): | |
351 title=value | |
352 elif name.endswith("storage"): | |
353 type=value | |
354 | |
355 linksLocator.append((title,link,type)) | |
356 | |
357 | |
358 | |
359 | |
360 | |
361 | |
362 | |
363 | |
364 | |
11 | 365 path = ".//escidocMetadataRecords:md-records/escidocMetadataRecords:md-record/escidocMetadataProfile:publication" |
14 | 366 publicationTag= item.find(path,ns); |
367 | |
368 return citation.text,publicationTag.get('type'),bookID,linksIdentifier,linksLocator | |
11 | 369 |
2 | 370 if citation is not None: |
371 | |
372 return citation.text | |
11 | 373 |
374 return "",'' | |
2 | 375 |
0 | 376 def pubmanConnectorURL(self): |
377 return self.connectorString | |
4 | 378 |
379 | |
10 | 380 def getPublicationsFromContext(self,context,limit=None,publicationType=None,search=None): |
7 | 381 """gibt alle publicationen des context, jeweils als tupel ("escidoc:id",METADATEN) |
382 | |
383 METADATEN ist hierbei eine Map mit : | |
384 "citation" --> citation in der APA formatierung | |
385 "volume" --> volume | |
386 "link" --> dowloadlink | |
387 "abstracts" --> map mit deu/eng für den abstrakt | |
388 "authors" --> [(NACHNAME,VORNAME]),..] | |
389 "title"--> title | |
390 "year" --> issued | |
391 """ | |
16 | 392 h = httplib2.Http(cacheFolder,timeout=TIMEOUT) |
4 | 393 |
394 if publicationType is None: | |
10 | 395 cn = self.connectorString+"cqlQuery=(escidoc.context.objid=%22"+context+"%22" |
4 | 396 #cn = self.connectorString+"cqlQuery=escidoc.objid=%22"+"escidoc:643455"+"%22&" |
397 else: | |
10 | 398 cn = self.connectorString+"cqlQuery=(escidoc.context.objid=%22"+context+"%22" |
399 cn +="%20and%20escidoc.publication.type=%22"+publicationType+"%22" | |
4 | 400 |
10 | 401 if search is not None and search != "": |
402 try: | |
403 search = unicodedata.normalize('NFKD', search).encode('ASCII', 'ignore') | |
404 except: | |
405 search = unicodedata.normalize('NFKD', search.decode('utf-8')).encode('ASCII', 'ignore') | |
406 cn+="%20and%20escidoc.metadata="+search+"" | |
407 | |
408 | |
409 cn +=")&exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" | |
4 | 410 if limit: |
411 cn+="&maximumRecords=%s"%limit | |
412 | |
9 | 413 startTime = time.time() |
12 | 414 try: |
415 logging.debug("getPublicationsFromContext: getting %s"%cn) | |
416 resp, content = h.request(cn) | |
417 logging.debug("getPublicationsFromContext: got data in %ss"%(time.time()-startTime)) | |
4 | 418 |
12 | 419 ET.register_namespace("dcterms", "http://purl.org/dc/terms/") |
4 | 420 |
12 | 421 root = ET.fromstring(content) |
422 | |
423 except Exception, e: | |
424 logging.error("Unable to read and parse data! %s"%e) | |
425 return [] | |
426 | |
4 | 427 #<escidocItem:item objid="escidoc:630782" |
428 | |
429 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" | |
430 abstractpath=".//{http://purl.org/dc/terms/}abstract" | |
6 | 431 issuedpath=".//{http://purl.org/dc/terms/}issued" |
432 | |
433 creatorpath=".//{http://escidoc.mpg.de/metadataprofile/schema/0.1/publication}creator/{http://escidoc.mpg.de/metadataprofile/schema/0.1/types}person" | |
434 familyNamepath=".//{http://escidoc.mpg.de/metadataprofile/schema/0.1/types}family-name" | |
435 givenNamepath=".//{http://escidoc.mpg.de/metadataprofile/schema/0.1/types}given-name" | |
436 | |
437 | |
438 titlepath=".//{http://purl.org/dc/elements/1.1/}title" | |
4 | 439 |
440 objxpath=".//{http://www.escidoc.de/schemas/item/0.8}item" | |
441 srcpath=".//{http://escidoc.mpg.de/metadataprofile/schema/0.1/publication}source" | |
442 volumepath=".//{http://escidoc.mpg.de/metadataprofile/schema/0.1/types}volume" | |
443 | |
444 #linkspath=""".//{http://www.escidoc.de/schemas/components/0.8}component/{http://www.escidoc.de/schemas/components/0.8}content[@storage="internal-managed"]""" | |
445 linkspath=""".//{http://www.escidoc.de/schemas/components/0.8}component/{http://www.escidoc.de/schemas/components/0.8}content[@storage="external-url"]""" | |
446 #linkspath=".//{http://www.escidoc.de/schemas/components/0.8}component/{http://www.escidoc.de/schemas/components/0.8}content" | |
447 citations=root.findall(objxpath) | |
448 | |
449 ret=[] | |
450 for citation in citations: | |
451 objId = citation.get('objid') | |
452 | |
453 text = citation.find(citationxpath) | |
454 | |
455 #Get volume = preprintID | |
456 # <publication:source type="series"> | |
457 # <dc:title>Max-Planck-Institut für Wissenschaftsgeschichte : Preprint</dc:title> | |
458 # <escidoc:volume>437</escidoc:volume> | |
459 | |
460 src= citation.find(srcpath) | |
461 vol = src.find(volumepath) | |
462 | |
463 #get link to fulltext | |
464 #<escidocComponents:component objid="escidoc:644183"> | |
465 #<escidocComponents:properties> | |
466 # <prop:creation-date>2013-04-29T09:00:01.100Z</prop:creation-date> | |
467 # <prop:valid-status>valid</prop:valid-status> | |
468 # <prop:visibility>public</prop:visibility> | |
469 # <prop:content-category>pre-print</prop:content-category> | |
470 # <prop:file-name>P437.PDF</prop:file-name> | |
471 # <prop:mime-type>application/pdf</prop:mime-type> | |
472 # <prop:checksum>d0ccdc62d6707d934e60e9839ffe30bf</prop:checksum> | |
473 # <prop:checksum-algorithm>MD5</prop:checksum-algorithm> | |
474 #</escidocComponents:properties> | |
475 #<escidocComponents:content xlink:type="simple" xlink:title="P437.PDF" storage="internal-managed" | |
476 # xlink:href="http://pubman.mpiwg-berlin.mpg.de/pubman/item/escidoc:643686:3/component/escidoc:644183/P437.PDF"/> | |
477 # | |
478 | |
479 src= citation.find(linkspath) | |
480 if src is not None: | |
481 | |
482 link=src.get("{http://www.w3.org/1999/xlink}href") | |
483 #logging.debug(src.attrib) | |
484 | |
485 else: | |
486 link ="" | |
487 | |
488 #<dcterms:abstract xml:lang="deu">Dieser Preprint versammelt eine Auswahl von Beiträgen zum Symposium zu Ehren von Hans-Jörg Rheinbergers 65. Geburtstag. Es fand am 24.1.2011 im Max-Planck-Institute für Wissenschaftsgeschichte statt und brachte Freunde, Studenten und Kollegen von Hans-Jörg Rheinberger zusammen.</dcterms:abstract> | |
489 #<dcterms:abstract xml:lang="eng">In this preprint, a selection of contributions to the symposium in honor of Hans-Jörg Rheinberger’s 65th birthday is published. It took place on January 24, 2011 at the Max-Planck-Institute for the History of Science and assembled friends, students and colleagues of Hans-Jörg Rheinberger.</dcterms:abstract> | |
490 | |
491 abstracts = citation.findall(abstractpath) | |
492 | |
493 abstractTexts={} | |
494 for abstract in abstracts: | |
495 | |
496 lang = abstract.get("{http://www.w3.org/XML/1998/namespace}lang") | |
497 abstractTexts[lang]=abstract.text | |
6 | 498 |
499 authorsTags = citation.findall(creatorpath) | |
500 | |
501 authors=[] | |
502 for author in authorsTags: | |
503 | |
504 gn= author.find(givenNamepath).text | |
505 fn= author.find(familyNamepath).text | |
506 | |
507 authors.append((fn,gn)) | |
508 | |
8
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
509 titleTag = citation.find(titlepath) |
6 | 510 |
511 if titleTag is not None: | |
512 title = titleTag.text | |
513 else: | |
514 title="" | |
515 | |
516 issuedTag = citation.find(issuedpath) | |
517 | |
518 if issuedTag is not None: | |
519 issued = issuedTag.text | |
520 else: | |
521 issued="" | |
4 | 522 |
8
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
523 item = {"id":objId, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
524 "citation":text.text, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
525 "volume":vol.text, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
526 "link":link, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
527 "abstracts":abstractTexts, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
528 "authors":authors, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
529 "title":title, |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
530 "year":issued} |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
531 |
ddd7e357e518
changed getPreprints to getPublicationsFromContext. returns simple list.
casties
parents:
7
diff
changeset
|
532 ret.append(item) |
9 | 533 |
534 logging.debug("getPublicationsFromContext: done in %ss"%(time.time()-startTime)) | |
4 | 535 return ret |
536 | |
537 | |
538 | |
0 | 539 |
540 def manage_addZopePubmanConnectorForm(self): | |
541 """Form for external Links""" | |
542 pt=zptFile(self, 'zpt/AddZopePubmanConnector.zpt') | |
543 return pt() | |
544 | |
545 | |
546 def manage_addZopePubmanConnector(self,id,title,pubmanURL,RESPONSE=None): | |
547 """Add an external Link""" | |
548 | |
549 newObj=ZopePubmanConnector(id,title,pubmanURL) | |
550 | |
551 self._setObject(id,newObj) | |
552 | |
553 if RESPONSE is not None: | |
554 RESPONSE.redirect('manage_main') | |
555 |