changeset 37:e231cff8688b

getFormatttedlabel in json verison
author dwinter
date Wed, 05 Jun 2013 14:30:03 +0200
parents 559907a4d538
children 67115536b7ec
files MetaDataFolder.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MetaDataFolder.py	Thu May 16 18:04:14 2013 +0200
+++ b/MetaDataFolder.py	Wed Jun 05 14:30:03 2013 +0200
@@ -270,6 +270,21 @@
             """get the metadafrom server"""
             logging.debug("getBibFormattedMetaDataExtended(path=%s)"%path)
             return self.resource.meta.bib.getFormatted('metadata_extended_template', path=path, dom=dom, data=bibdata, xdata=bibxdata, allFields=True)
+   
+   
+    def getBibFormattedLabelJSON(self, path=None, dom=None, bibdata=None, bibxdata=None):
+            """get the formatted metadafrom server as json, takes bibdata json-formatted"""
+            import json
+           
+            logging.debug("getBibFormattedMetaData(path=%s)"%path)
+           
+            if bibdata is None:
+                bibdata=self.REQUEST.form
+            
+         
+            bibdata = json.loads(bibdata,'utf-8')
+           
+            return json.dumps(self.resource.meta.bib.getFormatted('label_template', path=path, dom=dom, data=bibdata, xdata=bibxdata))
             
     def getBibFormattedLabel(self,path=None, dom=None, bibdata=None):
             """get the metadafrom server"""