--- ECHO_content/VLPExtension.py 2010/02/15 19:03:28 1.92 +++ ECHO_content/VLPExtension.py 2010/09/14 12:44:57 1.93 @@ -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 * @@ -499,6 +501,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 +857,8 @@ class VLP_resource(ECHO_resource,Cacheab logging.debug(title) return title + + def getImagePath(self): """Pfad zu den Images""" path=None