--- ECHO_content/VLPExtension.py 2009/06/09 14:05:20 1.91 +++ ECHO_content/VLPExtension.py 2012/01/03 13:02:31 1.95 @@ -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 * @@ -163,7 +165,7 @@ def manage_addSendMailForm(self, id, toA class VLP_collectionFolder(Folder): - """klasse fŸr folder innheralb der collection""" + """klasse fuer folder innerhalb der collection""" meta_type="VLP_collectionFolder" class VLP_essay(Folder): @@ -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") @@ -486,7 +490,7 @@ def manage_addVLP_subCollection(self,id, from zope.publisher.interfaces import IPublishTraverse from zope.interface import implements from zope.publisher.interfaces import NotFound -from zope.app import zapi +#from zope.app import zapi from zope.component import queryMultiAdapter try: from ZPublisher.BaseRequest import DefaultPublishTraverse @@ -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 @@ -959,7 +982,7 @@ class VLP_resource(ECHO_resource,Cacheab else: - self._setObject('fulltext',ECHO_fullText(id,'')) + self._setObject('fulltext',ECHO_fullText('fulltext','')) try: getattr(self,'fulltext').pt_edit(re3.encode('utf-8','ignore'),'text/xml')