# HG changeset patch # User dwinter # Date 1367244084 -7200 # Node ID 225179dfd89229af3d46750bc1babd0ada266532 # Parent 955d102392dbc6227ff970d2832a3086cbd655db getPublications erweitert nach Typ ausserdem erh?lt man jetzt auch einzelne Publicationen nach escidoc:id diff -r 955d102392db -r 225179dfd892 MPIWGStaff.py --- a/MPIWGStaff.py Sat Apr 27 10:04:57 2013 +0200 +++ b/MPIWGStaff.py Mon Apr 29 16:01:24 2013 +0200 @@ -1120,11 +1120,11 @@ return tmp - def getPublications(self,coneId="renn"): + def getPublications(self,coneId="renn",limit=None,publicationType=None): logging.debug("coneID:%s"%coneId) try: - pubs=self.mpiwgPubman.getPublications(coneId) + pubs=self.mpiwgPubman.getPublications(coneId,limit=limit,publicationType=publicationType) return pubs except: @@ -1230,6 +1230,9 @@ return html%"" + + + def getTalks(self): return self.folder.executeZSQL("SELECT oid,* FROM talks WHERE key_main = %s",[self.content.key]) @@ -1412,6 +1415,28 @@ pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_downloads.zpt')).__of__(self) return pt() + def editPublications(self,REQUEST): + """editiere die Publications von der Webseite""" + + + data=REQUEST.form + + if data.has_key('selectionMode'): + query="UPDATE personal_www SET publications_mode=%s WHERE key=%s" + + self.executeZSQL(query,[data['selectionMode'],self.getKey()]) + + self.refresh_content() + + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_publications.zpt')).__of__(self) + return pt() + + + def refresh_content(self,): + + self.content = self.folder.executeZSQL("select * from personal_www where key = %s", [self.getKey()])[0] + + def changeDownloads(self,REQUEST): """"change the downloadable files""" self.invalidate_chache(); @@ -1563,13 +1588,126 @@ splitted = ident.split("@"); return splitted[0] - def getPublications(self): + def getPublications(self,limit=None,publicationType=None): + + + if self.content.publications_mode=="year" or publicationType is not None: + coneId = self.getConeId(); + if coneId: + pubs= self.folder.getPublications(coneId,limit=limit,publicationType=publicationType) + return pubs - coneId = self.getConeId(); - if coneId: - pubs= self.folder.getPublications(coneId) + elif self.content.publications_mode=="priority": + selPubs= self.getSelectedPublications() + + pubs=[] + for selPub in selPubs: + pubs.append((selPub.escidocid,self.mpiwgPubman.getEntryFromPubman(selPub.escidocid))) + return pubs - return [] + return {} + + + def publicationsFull(self,REQUEST): + """show publication""" + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','show_publications.zpt')).__of__(self) + return pt(member=self.content) + + + + + + def addPublicationsFromPubman(self,REQUEST): + """addPublications from pubman""" + + data=REQUEST.form + + if data.get("method",None) is None: + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','add_publications.zpt')).__of__(self) + return pt() + + if data.get("method") == "search": + entries= self.mpiwgPubman.search(data) + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','add_publications.zpt')).__of__(self) + + + return pt(values=entries) + + + + if data.get("method") == "add": + + return self.addEntriesToPublicationList(data) + #pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','add_publications.zpt')).__of__(self) + + + + def addEntriesToPublicationList(self,data): + """fuege eintrage aus data zur publications liste, + @param data Map mit escidocID --> value + value muss "add" sein damit hinzugefuegt wird""" + + for key in data.keys(): + + query="INSERT INTO pubmanbiblio (key_main,escidocId) values (%s,%s)" + + if data.get(key)=="add": + self.executeZSQL(query,[self.getKey(),key]) + + + + selectedPublications = self.getSelectedPublications() + + pt = PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','change_publications.zpt')).__of__(self) + + return pt() + + + def changePublications(self,REQUEST): + """change published publications""" + + data=REQUEST.form + + + if data.get("method","change"): + for key in data.keys(): + splitted=key.split("__") #format escidoc_id__p fuer priority, nur escidocid + value=data[key] + if len(splitted)==1: + self.deleteFromPublicationList(key); + + elif(splitted[1]) == "p": + self.setPublicationPriority(splitted[0],value); + + + pt = PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','change_publications.zpt')).__of__(self) + return pt() + + + def deleteFromPublicationList(self,escidocid): + """Loessche publication with escidoc id from publication list""" + + query ="DELETE FROM pubmanbiblio WHERE escidocid=%s and key_main=%s" + + self.executeZSQL(query,[escidocid,self.getKey()]); + + + def setPublicationPriority(self,escidocid,value): + + query="update pubmanbiblio set priority=%s where escidocid=%s and key_main=%s" + + self.executeZSQL(query,[value,escidocid,self.getKey()]); + + + def getSelectedPublications(self): + """hole publications aus der datenbank""" + + + query="select * from pubmanbiblio where key_main = %s order by priority" + + + return self.executeZSQL(query,[self.getKey()]) + InitializeClass(MPIWGStaffMember) diff -r 955d102392db -r 225179dfd892 zpt/staff/edit_publications.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/staff/edit_publications.zpt Mon Apr 29 16:01:24 2013 +0200 @@ -0,0 +1,29 @@ + + + + + + + +

Selection mode

+
+ + + + Show the five most recent publications. (no further action needed) + Show selected publications. + +
+ + + + + +
+ + \ No newline at end of file diff -r 955d102392db -r 225179dfd892 zpt/staff/member_index_html.zpt --- a/zpt/staff/member_index_html.zpt Sat Apr 27 10:04:57 2013 +0200 +++ b/zpt/staff/member_index_html.zpt Mon Apr 29 16:01:24 2013 +0200 @@ -7,7 +7,7 @@ + global baseUrl string:$root/${secmap/staff}/members_test/$username" /> @@ -54,12 +54,12 @@ more

--> -

- +

+

- more + more

+ + + + + +

+ +
Author/Editor:
+
Title:
+
Somewhere in the metadata:
+ + + + + + +
+
+ + + + + + + + + + +
+ + +
+ +
+
+ + diff -r 955d102392db -r 225179dfd892 zpt/staff/pubman/change_publications.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/staff/pubman/change_publications.zpt Mon Apr 29 16:01:24 2013 +0200 @@ -0,0 +1,30 @@ + + + + + + + + +
+
+ + + + + + + + + + +
+ + +
+ +
+
+ + diff -r 955d102392db -r 225179dfd892 zpt/staff/pubman/mappings.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/staff/pubman/mappings.xml Mon Apr 29 16:01:24 2013 +0200 @@ -0,0 +1,508 @@ + + + + + + + + + http://purl.org/escidoc/metadata/ves/publication-types/article + http://purl.org/eprint/type/Book + http://purl.org/eprint/type/BookItem + http://purl.org/escidoc/metadata/ves/publication-types/proceedings + http://purl.org/eprint/type/ConferencePaper + http://purl.org/escidoc/metadata/ves/publication-types/talk-at-event + http://purl.org/escidoc/metadata/ves/publication-types/conference-report + http://purl.org/eprint/type/ConferencePoster + http://purl.org/escidoc/metadata/ves/publication-types/courseware-lecture + http://purl.org/eprint/type/Thesis + http://purl.org/escidoc/metadata/ves/publication-types/paper + http://purl.org/eprint/type/Report + http://purl.org/escidoc/metadata/ves/publication-types/journal + http://purl.org/escidoc/metadata/ves/publication-types/issue + http://purl.org/escidoc/metadata/ves/publication-types/series + http://purl.org/escidoc/metadata/ves/publication-types/manuscript + http://purl.org/escidoc/metadata/ves/publication-types/other + + + journal + + article + article + + issue + book + book-item + proceedings + conference-paper + conference-report + poster + report + paper + talk-at-event + + courseware-lecture + thesis + series + manuscript + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + other + + other + + + + 29 + 3 + 3 + 1 + 2 + 28 + 7 + 9 ???? + 10 + 9 + 13 + 15 + 46 + 42 + 30 + 41 + 44 + 19 + 41 + 1 + + 41 + + + + + + http://www.loc.gov/loc.terms/relators/AUT + http://www.loc.gov/loc.terms/relators/ART + http://www.loc.gov/loc.terms/relators/EDT + http://purl.org/escidoc/metadata/ves/creator-roles/painter + http://www.loc.gov/loc.terms/relators/PHT + http://www.loc.gov/loc.terms/relators/ILL + http://www.loc.gov/loc.terms/relators/CMM + http://www.loc.gov/loc.terms/relators/TRC + http://www.loc.gov/loc.terms/relators/TRL + http://www.loc.gov/loc.terms/relators/SAD + http://www.loc.gov/loc.terms/relators/CTB + http://purl.org/escidoc/metadata/ves/creator-roles/publisher + http://www.loc.gov/loc.terms/relators/HNR + + + author + artist + editor + painter + photographer + illustrator + commentator + transcriber + translator + advisor + advisor + contributor + publisher + honoree + contributor + contributor + + author + contributor + + + author + editor + artist + contributor + contributor + contributor + contributor + artist + artist + artist + referee + advisor + advisor + contributor + translator + + author + contributor + + + + + + http://purl.org/escidoc/metadata/ves/review-methods/internal + http://purl.org/eprint/status/PeerReviewed + http://purl.org/escidoc/metadata/ves/review-methods/no-review + + + internal + peer + no-review + + + intrev + joureview + notrev + + + + + + http://purl.org/escidoc/metadata/ves/academic-degrees/master + http://purl.org/escidoc/metadata/ves/academic-degrees/diploma + http://purl.org/escidoc/metadata/ves/academic-degrees/magister + http://purl.org/escidoc/metadata/ves/academic-degrees/staatsexamen + http://purl.org/escidoc/metadata/ves/academic-degrees/phd + http://purl.org/escidoc/metadata/ves/academic-degrees/habilitation + http://purl.org/escidoc/metadata/ves/academic-degrees/bachelor + + + master + diploma + magister + staatsexamen + phd + habilitation + bachelor + + + master + diplom + magister + staatsexamen + + bachelor + + + + + + PUBLIC + USER + USER + + + + + + dan + deu + ell + eng + spa + fin + fra + ita + jpn + kor + nep + nld + pol + por + zho + + + da + de + el + en + es + fi + fr + it + ja + ko + ne + nl + pl + pt + zh + + + + + German + English + French + Spanish + Russian + Abkhazian + + Afrikaans + Albanian + + Amharic + Arabic + Armenian + Assamese + Aymara + Azerbaijani + + Bashkir + Basque + Bengali + + + Bislama + Bosnian + Breton + Bulgarian + Burmese + + Catalan + Chinese + Corsican + Croatian + Czech + Danish + Dutch + Estonian + + Fiji + Finnish + Frisian + Frisian + Frisian + Frisian + Gaelic + Galician + Georgian + Greek + Greenlandic + Guarani + + + + + + + + + + + + edocid + issn + isbn + + doi + isi + + url + uri + pii + + + + + + + + + + + + http://purl.org/escidoc/metadata/ves/content-categories/any-fulltext + http://purl.org/escidoc/metadata/ves/content-categories/pre-print + http://purl.org/escidoc/metadata/ves/content-categories/post-print + http://purl.org/escidoc/metadata/ves/content-categories/publisher-version + http://purl.org/escidoc/metadata/ves/content-categories/publisher-version + http://purl.org/escidoc/metadata/ves/content-categories/abstract + http://purl.org/escidoc/metadata/ves/content-categories/table-of-contents + http://purl.org/escidoc/metadata/ves/content-categories/table-of-contents + http://purl.org/escidoc/metadata/ves/content-categories/supplementary-material + http://purl.org/escidoc/metadata/ves/content-categories/supplementary-material + http://purl.org/escidoc/metadata/ves/content-categories/additional-material + http://purl.org/escidoc/metadata/ves/content-categories/administrative-files + http://purl.org/escidoc/metadata/ves/content-categories/copyright-transfer-agreement + http://purl.org/escidoc/metadata/ves/content-categories/correspondence + http://purl.org/escidoc/metadata/ves/content-categories/original-resolution + http://purl.org/escidoc/metadata/ves/content-categories/web-resolution + http://purl.org/escidoc/metadata/ves/content-categories/thumbnail + http://purl.org/escidoc/metadata/ves/content-categories/original-data + http://purl.org/escidoc/metadata/ves/content-categories/original-resolution + http://purl.org/escidoc/metadata/ves/content-categories/web-resolution + http://purl.org/escidoc/metadata/ves/content-categories/thumbnail + + + + any-fulltext + pre-print + post-print + publisher-version + abstract + table-of-contents + supplementary-material + additional-material + administrative-files + copyright-transfer-agreement + correspondence + jpeg-max + jpeg-default + jpeg-min + original-data + high resolution + web resolution + thumbnail + + + + + + + + diff -r 955d102392db -r 225179dfd892 zpt/staff/pubman/show_publications.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/staff/pubman/show_publications.zpt Mon Apr 29 16:01:24 2013 +0200 @@ -0,0 +1,74 @@ + + + + + + + +
+ +

+ +

+ +

+ main entry +

+ +

Selected publications

+ + + +

Books

+
    +
  • + + + + + +
  • +
+
+ + +

Book Chapters

+
    +
  • + + + + +
  • +
+
+ + +

Articles

+
    +
  • + + + + + +
  • +
+
+ +
+ + + +
+ + \ No newline at end of file