diff MetaDataFolder.py @ 15:41b90f09a1f2

new getdata
author casties
date Tue, 02 Aug 2011 12:34:11 +0200
parents 281d223aa361
children ba617e755c56
line wrap: on
line diff
--- a/MetaDataFolder.py	Mon Aug 01 19:30:12 2011 +0200
+++ b/MetaDataFolder.py	Tue Aug 02 12:34:11 2011 +0200
@@ -131,29 +131,29 @@
         obj = self.restrictedTraverse(xmlpath, None)
         return obj
 
-    def getXmlPathData(self, xmlpath, path=None, dom=None, allText=False, allOccurrences=False):
+    def getXmlPathData(self, xmlpath, path=None, dom=None, allText=False, all=False):
         """returns contents of element at xmlpath as dict"""
         logging.error("getXmlPathData(%s)"%xmlpath)
         mdObj = self.getXmlPathObj(xmlpath)
         if mdObj is not None:
-            return mdObj.getData(path=path, dom=dom, allText=allText, allOccurrences=allOccurrences)
+            return mdObj.getData(path=path, dom=dom, allText=allText, all=all)
         else:
             logging.error("getXmlPathData: MetaData element at '%s' not found!"%xmlpath)
             return None
 
-    def getXmlPathFormatted(self, xmlpath, template, path=None, dom=None, data=None, allFields=False, allText=False, allOccurrences=False):
+    def getXmlPathFormatted(self, xmlpath, template, path=None, dom=None, data=None, allFields=False, allText=False, all=False):
         """returns contents of element at xmlpath as dict"""
         logging.error("getXmlPathFormatted(xmlpath=%s, template=%s)"%(xmlpath,template))
         mdObj = self.getXmlPathObj(xmlpath)
         if mdObj is not None:
             if data is None:
-                data = mdObj.getData(path=path, dom=dom, allText=allText, allOccurrences=allOccurrences)
+                data = mdObj.getData(path=path, dom=dom, allText=allText, all=all)
                 
             if data is None:
                 return ''
             
             fmt = ''
-            if allOccurrences:
+            if all:
                 # data is list of elements
                 for d in data:
                     # concatenate formatted strings
@@ -180,21 +180,21 @@
         """returns contents of access tag as dict"""
         return self.getXmlPathData('resource/meta/access-conditions/access', path=path, dom=dom)
     
-    def getAttributionData(self, path=None, dom=None, allOccurrences=True):
+    def getAttributionData(self, path=None, dom=None, all=True):
         """returns contents of attribution tag as dict"""
-        return self.getXmlPathData('resource/meta/access-conditions/attribution', path=path, dom=dom, allOccurrences=allOccurrences)
+        return self.getXmlPathData('resource/meta/access-conditions/attribution', path=path, dom=dom, all=all)
     
-    def getAttributionFormatted(self, template, path=None, dom=None, data=None, allOccurrences=True):
+    def getAttributionFormatted(self, template, path=None, dom=None, data=None, all=True):
         """returns formatted contents of access tag"""
-        return self.getXmlPathFormatted('resource/meta/access-conditions/attribution', template, path=path, dom=dom, data=data, allOccurrences=allOccurrences)
+        return self.getXmlPathFormatted('resource/meta/access-conditions/attribution', template, path=path, dom=dom, data=data, all=all)
     
-    def getCopyrightData(self, path=None, dom=None, allOccurrences=True):
+    def getCopyrightData(self, path=None, dom=None, all=True):
         """returns contents of copyright tag as dict"""
-        return self.getXmlPathData('resource/meta/access-conditions/copyright', path=path, dom=dom, allText=True, allOccurrences=allOccurrences)
+        return self.getXmlPathData('resource/meta/access-conditions/copyright', path=path, dom=dom, allText=True, all=all)
     
-    def getCopyrightFormatted(self, template, path=None, dom=None, data=None, allOccurrences=True):
+    def getCopyrightFormatted(self, template, path=None, dom=None, data=None, all=True):
         """returns formatted contents of access tag"""
-        return self.getXmlPathFormatted('resource/meta/access-conditions/copyright', template, path=path, dom=dom, data=data, allOccurrences=allOccurrences)
+        return self.getXmlPathFormatted('resource/meta/access-conditions/copyright', template, path=path, dom=dom, data=data, all=all)
     
     def getBibData(self, path=None, dom=None):
         """returns contents of bib tag as dict"""