changeset 38:67115536b7ec default tip

DC as JSON export added
author dwinter
date Thu, 22 May 2014 12:09:20 +0200
parents e231cff8688b
children
files MetaDataFolder.py
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MetaDataFolder.py	Wed Jun 05 14:30:03 2013 +0200
+++ b/MetaDataFolder.py	Thu May 22 12:09:20 2014 +0200
@@ -246,6 +246,19 @@
         """returns dict with DC keys and data from bibdata"""
         return self.resource.meta.bib.getDCMappedData(bibdata)
        
+       
+    def getDCMappedDataJSON(self, bibdata):
+        """returns dict with DC keys and data from bibdata"""
+        import json
+       
+        if bibdata is None:
+            bibdata=self.REQUEST.form
+            
+         
+        bibdata = json.loads(bibdata,'utf-8')
+           
+        return  json.dumps(self.resource.meta.bib.getDCMappedData(bibdata));
+   
     def getBibFormattedMetaDataJSON(self, path=None, dom=None, bibdata=None, bibxdata=None):
             """get the metadafrom server as json, takes bibdata json-formatted"""
             import json