version 1.1, 2005/12/18 12:35:02
|
version 1.2, 2005/12/23 14:01:29
|
Line 194 class documentViewer(ZopePageTemplate):
|
Line 194 class documentViewer(ZopePageTemplate):
|
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','thumbs.zpt')).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','thumbs.zpt')).__of__(self) |
return pt(imageUrl=imageUrl,pt=imagepath[1],start=start) |
return pt(imageUrl=imageUrl,pt=imagepath[1],start=start) |
|
|
|
def imagePathThumb(self,path,start=0): |
|
"""path ist the path to the images it is assumes that the index.meta file is one level higher.""" |
|
|
|
path=path.replace("/mpiwg/online","") |
|
pt=getParamFromDigilib(path,'pt') |
|
imageUrl=genericDigilib+"/servlet/Scaler?fn=%s"%path |
|
|
|
pageT=PageTemplateFile(os.path.join(package_home(globals()),'zpt','thumbs.zpt')).__of__(self) |
|
return pageT(imageUrl=imageUrl,pt=pt,start=start) |
|
|
|
def headerFromIndexMeta(self,path): |
|
"""gibt header from index meta out""" |
|
|
|
metaData=self.metadata.main.meta.bib |
|
server="http://foxridge.mpiwg-berlin.mpg.de" |
|
path="/".join(path.split("/")[0:-1]) |
|
metaUrl=server+path+"/index.meta" |
|
|
|
dom = NonvalidatingReader.parseUri(metaUrl) |
|
type=dom.xpath("//bib/@type") |
|
if type and (len(type)>0): |
|
type=type[0].value |
|
else: |
|
type="generic" |
|
type=type.replace("-"," ")# wrong typesiin index meta "-" instead of " " |
|
hash=metaData.generateMappingForType(type) |
|
|
|
author=getTextFromNode(dom.xpath("//bib/%s"%hash['author'][0])[0]) |
|
title=getTextFromNode(dom.xpath("//bib/%s"%hash['title'][0])[0]) |
|
year=getTextFromNode(dom.xpath("//bib/%s"%hash['year'][0])[0]) |
|
|
|
return author,title,year |
|
|
def text(self,mode,url,pn): |
def text(self,mode,url,pn): |
"""give text""" |
"""give text""" |
if mode=="texttool": #index.meta with texttool information |
if mode=="texttool": #index.meta with texttool information |
Line 234 class documentViewer(ZopePageTemplate):
|
Line 267 class documentViewer(ZopePageTemplate):
|
list.append(endNode.parentNode) |
list.append(endNode.parentNode) |
|
|
if p==e:# beide im selben paragraphen |
if p==e:# beide im selben paragraphen |
|
pass |
else: |
# else: |
next=p |
# next=p |
while next!=e: |
# while next!=e: |
print next,e |
# print next,e |
list.append(next) |
# list.append(next) |
next=next.nextSibling |
# next=next.nextSibling |
|
# |
for x in list: |
# for x in list: |
PrettyPrint(x) |
# PrettyPrint(x) |
|
# |
return list |
# return list |
|
# |
def image(self,mode,url,pn): |
def image(self,mode,url,pn): |
"""give image out""" |
"""give image out""" |
if mode=="texttool": #index.meta with texttool information |
if mode=="texttool": #index.meta with texttool information |
(viewerUrl,imagepath,textpath)=parseUrlTextTool(url) |
(viewerUrl,imagepath,textpath)=parseUrlTextTool(url) |
|
if not viewerUrl: |
|
viewerUrl=self.imageViewerUrl |
url=viewerUrl+"pn=%s&fn=%s"%(pn,imagepath[0]) |
url=viewerUrl+"pn=%s&fn=%s"%(pn,imagepath[0]) |
ret="""<iframe height="100%%" width="100%%" src="%s"/>"""%url |
ret="""<iframe height="100%%" width="100%%" src="%s"/>"""%url |
return url |
return url |
|
elif mode=="imagepath": |
|
url=url.replace("/mpiwg/online","") |
|
url=self.imageViewerUrl+"pn=%s&fn=%s"%(pn,url) |
|
ret="""<iframe height="100%%" width="100%%" src="%s"/>"""%url |
|
return url |
|
|
|
|
def thumbs(self,mode,url,start): |
def thumbs(self,mode,url,start): |
"""give thumbs out""" |
"""give thumbs out""" |
if mode=="texttool": #index.meta with texttool information |
if mode=="texttool": #index.meta with texttool information |
return self.textToolThumb(url,int(start)) |
return self.textToolThumb(url,int(start)) |
|
elif mode=="imagepath": |
|
return self.imagePathThumb(url,int(start)) |
|
|
security.declareProtected('View','index_html') |
security.declareProtected('View','index_html') |
|
|
|
|
def index_html(self,mode,url,start=0,pn=0): |
def index_html(self,mode,url,start=0,pn=1): |
''' |
''' |
view it |
view it |
@param mode: defines which type of document is behind url |
@param mode: defines which type of document is behind url |