version 1.9, 2006/04/12 17:47:53
|
version 1.10, 2006/04/12 18:53:00
|
Line 177 class documentViewer(Folder):
|
Line 177 class documentViewer(Folder):
|
except: |
except: |
zLOG.LOG("documentViewer (getdirinfofromdigilib)", zLOG.ERROR, "error reading %s (try %d)"%(imageUrl,cnt)) |
zLOG.LOG("documentViewer (getdirinfofromdigilib)", zLOG.ERROR, "error reading %s (try %d)"%(imageUrl,cnt)) |
else: |
else: |
raise IOError("Unable to get dirinfo from %s"%(imageUrl)) |
raise IOError("Unable to get dir-info from %s"%(imageUrl)) |
|
|
params=dom.xpath("//dir/size") |
sizes=dom.xpath("//dir/size") |
zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo:size"%params) |
zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo:size"%sizes) |
|
|
if params: |
if sizes: |
docinfo['numPages'] = int(getTextFromNode(params[0])) |
docinfo['numPages'] = int(getTextFromNode(sizes[0])) |
else: |
else: |
docinfo['numPages'] = 0 |
docinfo['numPages'] = 0 |
|
|
Line 199 class documentViewer(Folder):
|
Line 199 class documentViewer(Folder):
|
dom = NonvalidatingReader.parseUri(url) |
dom = NonvalidatingReader.parseUri(url) |
except: |
except: |
zLOG.LOG("documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
zLOG.LOG("documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
raise IOError("Unable to get info from %s"%(url)) |
raise IOError("Unable to read index.meta from %s"%(url)) |
else: |
else: |
# online path |
# online path |
server=self.digilibBaseUrl+"/servlet/Texter?fn=" |
server=self.digilibBaseUrl+"/servlet/Texter?fn=" |
Line 210 class documentViewer(Folder):
|
Line 210 class documentViewer(Folder):
|
dom = NonvalidatingReader.parseUri(metaUrl) |
dom = NonvalidatingReader.parseUri(metaUrl) |
except: |
except: |
zLOG.LOG("documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
zLOG.LOG("documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
raise IOError("Unable to get info from %s"%(url)) |
raise IOError("Unable to read index meta from %s"%(url)) |
|
|
return dom |
return dom |
|
|
|
|
def getAuthinfoFromIndexMeta(self,path,docinfo=None,dom=None): |
def getAuthinfoFromIndexMeta(self,path,docinfo=None,dom=None): |
"""gets authorization info from the index.meta file at path or given by dom""" |
"""gets authorization info from the index.meta file at path or given by dom""" |
zLOG.LOG("documentViewer (getbibinfofromindexmeta)", zLOG.INFO,"path: %s"%(path)) |
zLOG.LOG("documentViewer (getauthinfofromindexmeta)", zLOG.INFO,"path: %s"%(path)) |
|
|
access = None |
access = None |
|
|
Line 293 class documentViewer(Folder):
|
Line 293 class documentViewer(Folder):
|
if imageDirs and (len(imageDirs)>0): |
if imageDirs and (len(imageDirs)>0): |
imageDir=getTextFromNode(imageDirs[0]) |
imageDir=getTextFromNode(imageDirs[0]) |
else: |
else: |
imageDir=None |
# we balk with no image tag |
|
raise IOError("No text-tool info in %s"%(url)) |
|
|
if imageDir and archivePath: |
if imageDir and archivePath: |
#print "image: ", imageDir, " archivepath: ", archivePath |
#print "image: ", imageDir, " archivepath: ", archivePath |
Line 352 class documentViewer(Folder):
|
Line 353 class documentViewer(Folder):
|
docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo) |
docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo) |
else: |
else: |
zLOG.LOG("documentViewer (getdocinfo)", zLOG.ERROR,"unknown mode!") |
zLOG.LOG("documentViewer (getdocinfo)", zLOG.ERROR,"unknown mode!") |
|
raise ValueError("Unknown mode %s"%(mode)) |
|
|
zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"docinfo: %s"%docinfo) |
zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"docinfo: %s"%docinfo) |
self.REQUEST.SESSION['docinfo'] = docinfo |
self.REQUEST.SESSION['docinfo'] = docinfo |
return docinfo |
return docinfo |