version 1.50, 2010/05/07 14:11:49
|
version 1.53, 2010/05/19 16:24:16
|
Line 547 class documentViewer(Folder):
|
Line 547 class documentViewer(Folder):
|
if textUrls and (len(textUrls) > 0): |
if textUrls and (len(textUrls) > 0): |
textUrl = getTextFromNode(textUrls[0]) |
textUrl = getTextFromNode(textUrls[0]) |
docinfo['textURLPath'] = textUrl |
docinfo['textURLPath'] = textUrl |
|
if not docinfo['imagePath']: |
|
# text-only, no page images |
|
docinfo = self.getNumPages(docinfo) #im moment einfach auf eins setzen, navigation ueber die thumbs geht natuerlich nicht |
|
|
presentationUrls = dom.xpath("//texttool/presentation") |
presentationUrls = dom.xpath("//texttool/presentation") |
docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag |
docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag |
Line 559 class documentViewer(Folder):
|
Line 562 class documentViewer(Folder):
|
presentationUrl = url.replace('index.meta', presentationPath) |
presentationUrl = url.replace('index.meta', presentationPath) |
else: |
else: |
presentationUrl = url + "/" + presentationPath |
presentationUrl = url + "/" + presentationPath |
docinfo = self.getNumPages(docinfo) #im moment einfach auf eins setzen, navigation ueber die thumbs geht natuerlich nicht |
|
docinfo = self.getBibinfoFromTextToolPresentation(presentationUrl, docinfo=docinfo, dom=dom) |
docinfo = self.getBibinfoFromTextToolPresentation(presentationUrl, docinfo=docinfo, dom=dom) |
|
|
docinfo = self.getAuthinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get access info |
docinfo = self.getAuthinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get access info |
Line 702 class documentViewer(Folder):
|
Line 705 class documentViewer(Folder):
|
tocMode = pageinfo['tocMode'] |
tocMode = pageinfo['tocMode'] |
tocPN = pageinfo['tocPN'] |
tocPN = pageinfo['tocPN'] |
selfurl = self.absolute_url() |
selfurl = self.absolute_url() |
|
logging.debug("documentViewer (gettoc) /mpdl/interface/doc-query.xql?document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode)) |
page=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode) ,outputUnicode=False) |
page=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode) ,outputUnicode=False) |
pagexml = page.replace('?document=%s'%str(docpath),'?url=%s'%url) |
pagexml = page.replace('?document=%s'%str(docpath),'?url=%s'%url) |
pagedom = Parse(pagexml) |
pagedom = Parse(pagexml) |
Line 720 class documentViewer(Folder):
|
Line 724 class documentViewer(Folder):
|
pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN)) |
pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN)) |
hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) |
hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) |
l.setAttributeNS(None, "onClick", "id='highlighting'") |
l.setAttributeNS(None, "onClick", "id='highlighting'") |
|
|
return serializeNode(pagenode) |
return serializeNode(pagenode) |
|
|
if (queryType=="fulltextMorph"): |
if (queryType=="fulltextMorph"): |
Line 757 class documentViewer(Folder):
|
Line 760 class documentViewer(Folder):
|
hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s'%(viewMode,tocMode,tocPN,pn)) |
hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s'%(viewMode,tocMode,tocPN,pn)) |
|
|
if href.startswith('../lt/lex.xql'): |
if href.startswith('../lt/lex.xql'): |
selfurl = self.absolute_url() |
# selfurl = self.absolute_url() |
hrefNode.nodeValue = href.replace('lt/lex.xql','%s/template/head_main_voc'%selfurl) |
hrefNode.nodeValue = href.replace('../lt/lex.xql','%s../template/head_main_voc'%selfurl) |
l.setAttributeNS(None, 'target', '_blank') |
l.setAttributeNS(None, 'target', '_blank') |
l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") |
l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") |
l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') |
l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') |
if href.startswith('../lt/lemma.xql'): |
if href.startswith('../lt/lemma.xql'): |
selfurl = self.absolute_url() |
#selfurl = self.absolute_url() |
hrefNode.nodeValue = href.replace('lt/lemma.xql','%s/template/head_main_lemma'%selfurl) |
hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s../template/head_main_lemma'%selfurl) |
l.setAttributeNS(None, 'target', '_blank') |
l.setAttributeNS(None, 'target', '_blank') |
l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") |
l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") |
l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') |
l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') |
Line 801 class documentViewer(Folder):
|
Line 804 class documentViewer(Folder):
|
pagedivs = pagedom.xpath("/div") |
pagedivs = pagedom.xpath("/div") |
#queryResultPage |
#queryResultPage |
if len(pagedivs) > 0: |
if len(pagedivs) > 0: |
|
|
pagenode = pagedivs[0] |
pagenode = pagedivs[0] |
|
links = pagenode.xpath("//a") |
|
for l in links: |
|
hrefNode = l.getAttributeNodeNS(None, u"href") |
|
if hrefNode: |
|
href= hrefNode.nodeValue |
|
if href.startswith('#note-0006-01'): |
|
selfurl = self.absolute_url() |
|
hrefNode.nodeValue = href.replace("href='#note-'",'xaxa/%s/'%selfurl) |
return serializeNode(pagenode) |
return serializeNode(pagenode) |
if mode == "xml": |
if mode == "xml": |
# first div contains text |
# first div contains text |