Mercurial > hg > ZopePubmanConnector
comparison zopePubmanConnector.py @ 11:69a2f0b8a932
sortieren von treffer listen nach typen
author | dwinter |
---|---|
date | Sun, 05 May 2013 17:10:22 +0200 |
parents | 007ba22a5eb1 |
children | 55294833888f |
comparison
equal
deleted
inserted
replaced
10:007ba22a5eb1 | 11:69a2f0b8a932 |
---|---|
63 h = httplib2.Http(cacheFolder) | 63 h = httplib2.Http(cacheFolder) |
64 | 64 |
65 | 65 |
66 | 66 |
67 if publicationType is None: | 67 if publicationType is None: |
68 cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22&" | 68 # cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22&" |
69 cn = self.connectorString+"cqlQuery=escidoc.publication.creator.person.identifier=%22"+personID+"%22&" | |
69 else: | 70 else: |
70 cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22" | 71 #cn = self.connectorString+"cqlQuery=escidoc.any-identifier=%22"+personID+"%22" |
72 cn = self.connectorString+"cqlQuery=escidoc.publication.creator.person.identifier=%22"+personID+"%22&" | |
71 cn +="%20and%20escidoc.publication.type=%22"+publicationType+"%22&" | 73 cn +="%20and%20escidoc.publication.type=%22"+publicationType+"%22&" |
72 | 74 |
73 cn +="exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" | 75 cn +="exportFormat=APA&outputFormat=snippet&language=all&sortKeys=escidoc.any-dates&sortOrder=descending" |
74 if limit: | 76 if limit: |
75 cn+="&maximumRecords=%s"%limit | 77 cn+="&maximumRecords=%s"%limit |
196 | 198 |
197 | 199 |
198 | 200 |
199 return ret | 201 return ret |
200 | 202 |
201 | 203 |
202 | 204 def getEntriesFromPubman(self,escidocids): |
203 def getEntryFromPubman(self,escidocid): | 205 |
206 doctypes={} | |
207 for escidocid in escidocids: | |
208 | |
209 txt, type = self.getEntryFromPubman(escidocid.escidocid, True) | |
210 | |
211 if not doctypes.has_key(type): | |
212 doctypes[type]=[] | |
213 | |
214 doctypes[type].append((escidocid.escidocid,txt)) | |
215 | |
216 | |
217 return doctypes | |
218 | |
219 | |
220 def getEntryFromPubman(self,escidocid,extendedData=None): | |
204 """get one entry""" | 221 """get one entry""" |
205 | 222 |
206 escidocid=escidocid.lstrip().strip() | 223 escidocid=escidocid.lstrip().strip() |
207 h = httplib2.Http(cacheFolder) | 224 h = httplib2.Http(cacheFolder) |
208 cn = self.connectorString+"cqlQuery=escidoc.objid=%s&" | 225 cn = self.connectorString+"cqlQuery=escidoc.objid=%s&" |
217 | 234 |
218 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" | 235 citationxpath=".//{http://purl.org/dc/terms/}bibliographicCitation" |
219 | 236 |
220 citation=root.find(citationxpath) | 237 citation=root.find(citationxpath) |
221 | 238 |
239 | |
240 if citation is not None and extendedData is not None: | |
241 ns = {'escidocMetadataProfile':"http://escidoc.mpg.de/metadataprofile/schema/0.1/", | |
242 'escidocMetadataRecords':"http://www.escidoc.de/schemas/metadatarecords/0.4" | |
243 } | |
244 | |
245 path = ".//escidocMetadataRecords:md-records/escidocMetadataRecords:md-record/escidocMetadataProfile:publication" | |
246 | |
247 publicationTag= root.find(path,ns); | |
248 return citation.text,publicationTag.get('type') | |
249 | |
222 if citation is not None: | 250 if citation is not None: |
223 | 251 |
224 return citation.text | 252 return citation.text |
225 | 253 |
226 return "" | 254 return "",'' |
227 | 255 |
228 def pubmanConnectorURL(self): | 256 def pubmanConnectorURL(self): |
229 return self.connectorString | 257 return self.connectorString |
230 | 258 |
231 | 259 |