version 1.60, 2005/06/05 10:10:44
|
version 1.61, 2005/07/04 11:01:02
|
Line 4 from Globals import Persistent,package_h
|
Line 4 from Globals import Persistent,package_h
|
from Acquisition import Implicit |
from Acquisition import Implicit |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
from Products.PageTemplates.PageTemplate import PageTemplate |
from Products.PageTemplates.PageTemplate import PageTemplate |
|
from xmlrpclib import ServerProxy |
import re |
import re |
import os |
import os |
import os.path |
import os.path |
Line 16 from types import *
|
Line 17 from types import *
|
import time |
import time |
from threading import Thread |
from threading import Thread |
import Queue |
import Queue |
|
import cgi |
|
|
try: |
try: |
from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder |
from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder |
except: |
except: |
Line 243 class metaData(SimpleItem):
|
Line 246 class metaData(SimpleItem):
|
return ret+"</body></html>" |
return ret+"</body></html>" |
|
|
|
|
|
|
|
|
class ImageDigilib(Folder,Persistent,Implicit): |
class ImageDigilib(Folder,Persistent,Implicit): |
"""Anzeige object fuer digilib""" |
"""Anzeige object fuer digilib""" |
meta_type="ImageDigilib" |
meta_type="ImageDigilib" |
Line 503 class ImageDigilib(Folder,Persistent,Imp
|
Line 508 class ImageDigilib(Folder,Persistent,Imp
|
def index_html(self): |
def index_html(self): |
"""show image""" |
"""show image""" |
#DEVELOP: take first one for server |
#DEVELOP: take first one for server |
|
#path="http://127.0.0.1:8080/zogilib_images?lv=2&fn="+self.ImageViewerPath+"/"+os.path.splitext(self.filename)[0] |
path="http://content.mpiwg-berlin.mpg.de/zogilib_images?lv=2&fn="+self.ImageViewerPath+"/"+os.path.splitext(self.filename)[0] |
path="http://content.mpiwg-berlin.mpg.de/zogilib_images?lv=2&fn="+self.ImageViewerPath+"/"+os.path.splitext(self.filename)[0] |
return self.REQUEST.RESPONSE.redirect(path) |
return self.REQUEST.RESPONSE.redirect(path) |
|
|
Line 533 class ImageCollection(Folder, Persistent
|
Line 538 class ImageCollection(Folder, Persistent
|
"""Sammelordner für Bilder""" |
"""Sammelordner für Bilder""" |
meta_type="ImageCollection" |
meta_type="ImageCollection" |
|
|
scalerPath="http://127.0.0.1:18080/digitallibrary/servlet/Scaler/?fn=" |
#scalerPath="http://127.0.0.1:18080/digitallibrary/servlet/Scaler/?fn=" |
#scalerPath="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?fn=" |
scalerPath="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?fn=" |
|
|
zipThreads={} |
zipThreads={} |
zipThreads2={} |
zipThreads2={} |
Line 546 class ImageCollection(Folder, Persistent
|
Line 551 class ImageCollection(Folder, Persistent
|
|
|
defaultMetaString="http://fm-web.mpiwg-berlin.mpg.de:8050/FMRes/FMPJS?-db=Wissenschaftlerportraits.fp5&-layID=69&-token=25&-max=1&-format=formvwcss.htm&-mode=browse&images::filename=%s&-find" ## TEST FUER IMAGEDATENBANK WP |
defaultMetaString="http://fm-web.mpiwg-berlin.mpg.de:8050/FMRes/FMPJS?-db=Wissenschaftlerportraits.fp5&-layID=69&-token=25&-max=1&-format=formvwcss.htm&-mode=browse&images::filename=%s&-find" ## TEST FUER IMAGEDATENBANK WP |
|
|
|
def getScalerPath(self): |
|
"""get ScalerPath""" |
|
return self.scalerPath |
|
|
|
def getImageViewerPath(self): |
|
"""get ImageViewerPath""" |
|
return self.ImageViewerPath |
|
|
|
def getImageStoragePath(self): |
|
"""get ImageStoragePath""" |
|
return self.ImageStoragePath |
|
|
def refreshTxt(self): |
def refreshTxt(self): |
"""txt fuer refresh""" |
"""txt fuer refresh""" |
Line 1463 def manage_AddImageCollection(self,id,ti
|
Line 1479 def manage_AddImageCollection(self,id,ti
|
class ImageCollectionMD(ImageCollection,ZSQLExtendFolder): |
class ImageCollectionMD(ImageCollection,ZSQLExtendFolder): |
"""Imageviewer and Metadata""" |
"""Imageviewer and Metadata""" |
meta_type="ImageCollection MD" |
meta_type="ImageCollection MD" |
scalerPath="http://127.0.0.1:18080/digitallibrary/servlet/Scaler/?fn=" |
#scalerPath="http://127.0.0.1:18080/digitallibrary/servlet/Scaler/?fn=" |
#scalerPath="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?fn=" |
scalerPath="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?fn=" |
manage_options=ImageCollection.manage_options+( |
manage_options=ImageCollection.manage_options+( |
{'label':'ZSQLExtend','action':'changeZSQLExtendForm'}, |
{'label':'ZSQLExtend','action':'changeZSQLExtendForm'}, |
) |
) |
Line 1558 def manage_AddImageCollectionIFrame(self
|
Line 1574 def manage_AddImageCollectionIFrame(self
|
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
|
|
class ImageZogiLib(ImageDigilib): |
|
"""Anzeige Object fuer Bilder ausserhalb von collections |
|
ImageViewerPath und ImageStoragePath und wenn vorhanden Pfad zur Collection |
|
werden zusaetzlich abgespeichert |
|
""" |
|
|
|
meta_type="ImageZogiLib" |
|
|
|
manage_options=ImageDigilib.manage_options+( |
|
{'label':'Main Config','action':'changeImageZogiLibForm'}, |
|
) |
|
|
|
def __init__(self,id,fn,ImageViewerPath,ImageStoragePath,scalerPath,ImageCollectionPath=None,REQUEST=None): |
|
ImageDigilib.__init__(self,id,fn) |
|
self.ImageViewerPath=ImageViewerPath |
|
self.ImageStoragePath=ImageStoragePath |
|
self.ImageCollectionPath=ImageCollectionPath |
|
self.scalerPath=scalerPath |
|
|
|
def changeImageZogiLibForm(self): |
|
"""change zogilib Form""" |
|
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeImageZogiLib.zpt')).__of__(self) |
|
return pt() |
|
|
|
|
|
def changeImageZogilib(fn,ImageViewerPath,ImageStoragePath,scalerPath,ImageCollectionPath,REQUEST=None): |
|
"""Change it""" |
|
self.ImageViewerPath=ImageViewerPath |
|
self.ImageStoragePath=ImageStoragePath |
|
self.ImageCollectionPath=ImageColectionPath |
|
self.scalerPath=scalerPath |
|
|
|
def manage_AddImageZogiLib(self,id=None,ImageViewerPath=None,ImageStoragePath=None,fileUpload=None,ImageCollectionPath=None,scalerPath=None,libPath=None,caption=None,RESPONSE=None): |
|
"""hinzufuegen eineis zogilibImage""" |
|
|
|
if libPath: |
|
splitted=libPath.split("?") |
|
urlSplit=splitted[0].split("/") |
|
params=cgi.parse_qs(splitted[1]) |
|
#is LibPath a digilib path? |
|
if urlSplit[-1]=="Scaler": |
|
if type(params['fn']) is ListType: |
|
fnParam=params['fn'][0] |
|
else: |
|
fnParam=params['fn'] |
|
fileNameSplit=os.path.split(fnParam) |
|
ImageViewerPath=fileNameSplit[0] |
|
id=fileNameSplit[1] |
|
scalerPath=splitted[0]+"?fn=" |
|
else: #assume if not the path is a path to an ImageCollection |
|
if type(params['filename']) is ListType: |
|
id=params['filename'][0] |
|
else: |
|
id=params['filename'] |
|
|
|
server=ServerProxy(splitted[0]) |
|
ImageCollectionPath=libPath |
|
ImageViewerPath=server.getImageViewerPath() |
|
ImageStoragePath=server.getImageStoragePath() |
|
scalerPath=server.getScalerPath() |
|
|
|
|
|
|
|
if fileUpload: |
|
fn=splitPath(fileUpload.filename) |
|
else: |
|
fn=id |
|
|
|
newObj=ImageZogiLib(id,fn,ImageViewerPath,ImageStoragePath,scalerPath,ImageCollectionPath) |
|
|
|
self._setObject(id,newObj) |
|
getattr(self,id).caption=caption[0:] |
|
if fileUpload: |
|
getattr(self,id).uploadImage(fileupload,self.ImageStoragePath) |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
|
def manage_AddImageZogiLibForm(self): |
|
"""to be done""" |
|
|