version 1.21, 2004/03/31 19:14:17
|
version 1.23, 2004/07/19 14:30:14
|
Line 74 class ImageDigilib(Folder,Persistent,Imp
|
Line 74 class ImageDigilib(Folder,Persistent,Imp
|
f=open(filename,"w") |
f=open(filename,"w") |
f.write(filedata) |
f.write(filedata) |
f.close() |
f.close() |
|
try: |
os.chmod(filename,0644) |
os.chmod(filename,0644) |
|
except: |
|
"""hack""" |
|
|
os.popen("ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &"% self.ImageViewerPath) |
os.popen("ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &"% self.ImageViewerPath) |
|
|
|
|
Line 110 class ImageDigilib(Folder,Persistent,Imp
|
Line 114 class ImageDigilib(Folder,Persistent,Imp
|
"""show image""" |
"""show image""" |
#DEVELOP: take first one for server |
#DEVELOP: take first one for server |
|
|
path="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/digilib.jsp?lv=2&fn="+self.ImageViewerPath+"/"+self.filename |
path="http://content.mpiwg-berlin.mpg.de/zogilib_images?lv=2&fn="+self.ImageViewerPath+"/"+self.filename |
|
|
#path="http://localhost:8080/mpiwg/online/"+self.ImageViewerPath+"/"+self.filename |
#path="http://localhost:8080/mpiwg/online/"+self.ImageViewerPath+"/"+self.filename |
#self.REQUEST.SESSION['string']="<img src=\"%s\">"% path |
#self.REQUEST.SESSION['string']="<img src=\"%s\">"% path |
Line 164 class ImageCollection(Folder, Persistent
|
Line 168 class ImageCollection(Folder, Persistent
|
{'label':'Recalculate Metadata','action':'recalculateMeta'}, |
{'label':'Recalculate Metadata','action':'recalculateMeta'}, |
{'label':'Import Metadata','action':'importMetaForm'}, |
{'label':'Import Metadata','action':'importMetaForm'}, |
{'label':'Rescale thumbs','action':'scaleThumbs'}, |
{'label':'Rescale thumbs','action':'scaleThumbs'}, |
|
{'label':'Weight (ECHO)','action':'weightForm'}, |
) |
) |
|
|
|
def weightForm(self): |
|
"""Weight""" |
|
pt=PageTemplateFile('Products/ImageArchive/zpt/changeWeight.zpt').__of__(self) |
|
return pt() |
|
|
|
def changeWeight(self,weight,RESPONSE=None): |
|
"""Change weight""" |
|
self.weight=weight |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
def importMetaForm(self): |
def importMetaForm(self): |
"""import metadata""" |
"""import metadata""" |
Line 534 class ImageCollection(Folder, Persistent
|
Line 551 class ImageCollection(Folder, Persistent
|
try: |
try: |
rows=int(REQUEST.cookies["ImageViewerRows"]) |
rows=int(REQUEST.cookies["ImageViewerRows"]) |
except: |
except: |
rows=None |
rows=6 |
else: |
else: |
rows=None |
rows=6 |
|
|
if REQUEST.cookies.has_key("ImageViewerCols"): |
if REQUEST.cookies.has_key("ImageViewerCols"): |
#print "COLS",REQUEST.cookies["ImageViewerCols"] |
#print "COLS",REQUEST.cookies["ImageViewerCols"] |
cols=int(REQUEST.cookies["ImageViewerCols"]) |
cols=int(REQUEST.cookies["ImageViewerCols"]) |
else: |
else: |
cols=3 |
cols=2 |
|
|
idsnumber=len(self.show_thumbs()) |
idsnumber=len(self.show_thumbs()) |
if rows: |
if rows: |
if cols*rows >idsnumber: |
if cols*rows >idsnumber: |
rows=int(idsnumber/cols)+1 |
rows=int(idsnumber/cols)+1 |
|
|
|
#print cols,rows |
return (cols,rows) |
return (cols,rows) |
|
|
|
|
Line 558 class ImageCollection(Folder, Persistent
|
Line 577 class ImageCollection(Folder, Persistent
|
|
|
if self.REQUEST.SESSION.has_key("filename"): |
if self.REQUEST.SESSION.has_key("filename"): |
filename=self.REQUEST.SESSION["filename"] |
filename=self.REQUEST.SESSION["filename"] |
|
|
|
|
try: |
try: |
startId=filename |
startId=filename |
|
if startId=="": |
|
startId=idsAll[0][0:] |
except: |
except: |
startId=idsAll[0] |
startId=idsAll[0][0:] |
else: |
else: |
startId=idsAll[0] |
startId=idsAll[0][0:] |
|
|
|
|
|
|
print "NOR:",numberOfRows |
|
|
|
if numberOfRows: |
if numberOfRows: |
|
|
|
startPic=idsAll.index(startId) |
try: |
try: |
|
|
startPic=idsAll.index(startId) |
startPic=idsAll.index(startId) |
endPic=startPic+numberOfColumns*numberOfRows |
endPic=startPic+numberOfColumns*numberOfRows |
ids=idsAll[startPic:endPic] |
ids=idsAll[startPic:endPic] |
except: |
except: |
ids=idsAll |
ids=idsAll |
else: |
else: |
|
|
ids=idsAll |
ids=idsAll |
|
|
|
|
Line 613 class ImageCollection(Folder, Persistent
|
Line 640 class ImageCollection(Folder, Persistent
|
pt=PageTemplateFile('Products/ImageArchive/zpt/thumb2.zpt').__of__(self) |
pt=PageTemplateFile('Products/ImageArchive/zpt/thumb2.zpt').__of__(self) |
return pt() |
return pt() |
|
|
|
def thumblistNewWindow(self): |
|
"""Thumbs mit clik neues Fenster oeffnen""" |
|
pt=PageTemplateFile('Products/ImageArchive/zpt/thumbNewWindow.zpt').__of__(self) |
|
return pt() |
|
|
|
|
def navig_selected_html(self): |
def navig_selected_html(self): |
"""navigation""" |
"""navigation""" |
#self.REQUEST.SESSION['URL']=self.REQUEST['URL0'] |
#self.REQUEST.SESSION['URL']=self.REQUEST['URL0'] |
Line 666 class ImageCollectionIFrame(ImageCollect
|
Line 699 class ImageCollectionIFrame(ImageCollect
|
meta_type="ImageCollectionIFrame" |
meta_type="ImageCollectionIFrame" |
label=ImageCollection.title |
label=ImageCollection.title |
|
|
|
def getImageTag(self): |
|
""" hack : method needed by echo_content""" |
|
return "" |
|
|
def rotate(self,angle,url,RESPONSE): |
def rotate(self,angle,url,RESPONSE): |
"""rotate""" |
"""rotate""" |
|
|