version 1.90, 2009/05/06 07:53:46
|
version 1.95, 2012/01/03 13:02:31
|
Line 17 from types import *
|
Line 17 from types import *
|
from Globals import package_home |
from Globals import package_home |
import transaction |
import transaction |
import Acquisition |
import Acquisition |
|
import re |
|
import logging |
|
|
from Products.ECHO_content.ECHO_collection import * |
from Products.ECHO_content.ECHO_collection import * |
from vlp_xmlhelpers import * |
from vlp_xmlhelpers import * |
Line 163 def manage_addSendMailForm(self, id, toA
|
Line 165 def manage_addSendMailForm(self, id, toA
|
|
|
|
|
class VLP_collectionFolder(Folder): |
class VLP_collectionFolder(Folder): |
"""klasse fŸr folder innheralb der collection""" |
"""klasse fuer folder innerhalb der collection""" |
meta_type="VLP_collectionFolder" |
meta_type="VLP_collectionFolder" |
|
|
class VLP_essay(Folder): |
class VLP_essay(Folder): |
Line 308 class VLP_essay(Folder):
|
Line 310 class VLP_essay(Folder):
|
#txt=pages[int(pagenum)-1][1].data.decode('utf-8') |
#txt=pages[int(pagenum)-1][1].data.decode('utf-8') |
txt=pages[int(pagenum)-1][1].data |
txt=pages[int(pagenum)-1][1].data |
#print txt.encode('utf-8') |
#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: |
else: |
return self.xml2html(makeXML(pages[int(pagenum)-1][1]()),quote="no") |
return self.xml2html(makeXML(pages[int(pagenum)-1][1]()),quote="no") |
|
|
Line 486 def manage_addVLP_subCollection(self,id,
|
Line 490 def manage_addVLP_subCollection(self,id,
|
from zope.publisher.interfaces import IPublishTraverse |
from zope.publisher.interfaces import IPublishTraverse |
from zope.interface import implements |
from zope.interface import implements |
from zope.publisher.interfaces import NotFound |
from zope.publisher.interfaces import NotFound |
from zope.app import zapi |
#from zope.app import zapi |
from zope.component import queryMultiAdapter |
from zope.component import queryMultiAdapter |
try: |
try: |
from ZPublisher.BaseRequest import DefaultPublishTraverse |
from ZPublisher.BaseRequest import DefaultPublishTraverse |
Line 499 class VLP_collection(ECHO_collection,Acq
|
Line 503 class VLP_collection(ECHO_collection,Acq
|
|
|
|
|
implements(IPublishTraverse) |
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): |
def findObjFromLitName(self,fileName): |
if not fileName[0:3]=="lit": |
if not fileName[0:3]=="lit": |
logging.error("getOrCreateFolder wrong filename: %s"%fileName) |
logging.error("getOrCreateFolder wrong filename: %s"%fileName) |
Line 838 class VLP_resource(ECHO_resource,Cacheab
|
Line 859 class VLP_resource(ECHO_resource,Cacheab
|
logging.debug(title) |
logging.debug(title) |
return title |
return title |
|
|
|
|
|
|
def getImagePath(self): |
def getImagePath(self): |
"""Pfad zu den Images""" |
"""Pfad zu den Images""" |
path=None |
path=None |
Line 877 class VLP_resource(ECHO_resource,Cacheab
|
Line 900 class VLP_resource(ECHO_resource,Cacheab
|
if path is None: |
if path is None: |
|
|
|
|
if len (os.listdir(self.vlp_basis,self.resourceID,'pagesHi')) > len(os.listdir(path)): |
if len (os.listdir(os.path.join(self.vlp_basis,self.resourceID,'pagesHi'))) > len(os.listdir(path)): |
|
|
|
|
|
|
Line 959 class VLP_resource(ECHO_resource,Cacheab
|
Line 982 class VLP_resource(ECHO_resource,Cacheab
|
|
|
else: |
else: |
|
|
self._setObject('fulltext',ECHO_fullText(id,'')) |
self._setObject('fulltext',ECHO_fullText('fulltext','')) |
|
|
try: |
try: |
getattr(self,'fulltext').pt_edit(re3.encode('utf-8','ignore'),'text/xml') |
getattr(self,'fulltext').pt_edit(re3.encode('utf-8','ignore'),'text/xml') |
Line 976 class VLP_resource(ECHO_resource,Cacheab
|
Line 999 class VLP_resource(ECHO_resource,Cacheab
|
if not hasattr(self,'fulltext'): |
if not hasattr(self,'fulltext'): |
self.copyTranscriptionFromDB() |
self.copyTranscriptionFromDB() |
if not hasattr(self,'fulltext'): #still not |
if not hasattr(self,'fulltext'): #still not |
self._setObject('fulltext',None) |
|
|
|
if self.fulltext is None: |
|
return False |
return False |
else: |
|
return True |
return True |
|
|
def resetMetaLink(self,all="no",RESPONSE=None): |
def resetMetaLink(self,all="no",RESPONSE=None): |