--- ECHO_content/VLPExtension.py 2010/02/15 19:03:28 1.92 +++ ECHO_content/VLPExtension.py 2010/10/11 13:15:00 1.94 @@ -17,6 +17,8 @@ from types import * from Globals import package_home import transaction import Acquisition +import re +import logging from Products.ECHO_content.ECHO_collection import * from vlp_xmlhelpers import * @@ -308,7 +310,9 @@ class VLP_essay(Folder): #txt=pages[int(pagenum)-1][1].data.decode('utf-8') txt=pages[int(pagenum)-1][1].data #print txt.encode('utf-8') - return self.xml2html(makeXML(txt),quote="no") + tmp =makeXML(txt) + logging.debug(txt) + return self.xml2html(tmp,quote="no") else: return self.xml2html(makeXML(pages[int(pagenum)-1][1]()),quote="no") @@ -499,6 +503,23 @@ class VLP_collection(ECHO_collection,Acq implements(IPublishTraverse) + + + def foxridgePath2vlp(self,url,mk,RESPONSE=None): + """convertiert einen pfad zu einer url in vlp""" + litRe = re.match(r".*lit([0-9]*)",url) + logging.debug("foxridgePath2vlp URL:"+repr(url)) + lit = "lit"+litRe.group(1) + splitted=url.split("/") + path=splitted[-1].split(".")[0] + newUrl=lit+"?p=%s&mk=%s"%(path,mk) + + if RESPONSE: + RESPONSE.redirect(newUrl) + return + + return newUrl + def findObjFromLitName(self,fileName): if not fileName[0:3]=="lit": logging.error("getOrCreateFolder wrong filename: %s"%fileName) @@ -838,6 +859,8 @@ class VLP_resource(ECHO_resource,Cacheab logging.debug(title) return title + + def getImagePath(self): """Pfad zu den Images""" path=None