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