--- ECHO_content/ECHO_helpers.py 2008/11/19 14:22:42 1.93 +++ ECHO_content/ECHO_helpers.py 2008/12/04 21:27:00 1.94 @@ -27,6 +27,10 @@ def logger(txt,method,txt2): displayTypes = ['ZSQLExtendFolder','ZSQLBibliography','ECHO_group','ECHO_collection','ECHO_resource','ECHO_link','ECHO_sqlElement','ECHO_pageTemplate','ECHO_externalLink','ImageCollectionIFrame','VLP_resource','VLP_essay','ECHO_ZCatalogElement','ImageCollection','versionedFileFolder','extVersionedFileFolder','ECHO_movie'] +def normalizeCt(str): + """normalizes content_type""" + #str= str.replace(" ","_") + return str.replace("-"," ").lower() #decode and compress for xmlrpc communication with OSAS_server @@ -94,6 +98,17 @@ class ECHO_basis: """get the pid""" return getattr(self,'pid',None) + def getParentPID(self): + """get the PID of the parent""" + parent = self.aq_parent + + pidF = getattr(parent,'getPID',None) + + if pidF is None: + return None + + else: + return pidF() def unicodify(self, s): """return unicode object for string (utf-8 or latin1) or unicode object s"""