version 1.9, 2005/04/06 09:18:41
|
version 1.13, 2007/01/31 14:30:30
|
Line 16 from urlparse import *
|
Line 16 from urlparse import *
|
import re |
import re |
import xml.dom.minidom |
import xml.dom.minidom |
from types import * |
from types import * |
import zLOG |
import logging |
|
|
|
#ersetzt logging |
|
def logger(txt,method,txt2): |
|
"""logging""" |
|
logging.info(txt+ txt2) |
|
|
|
|
import os.path |
import os.path |
import Globals |
import Globals |
from Globals import package_home |
from Globals import package_home |
Line 85 class OSAS_add_contextData(Folder):
|
Line 92 class OSAS_add_contextData(Folder):
|
return curHandler.retStr.encode('utf-8') |
return curHandler.retStr.encode('utf-8') |
|
|
except: |
except: |
zLOG.LOG('OSAS_Root (addFileToDollection)',zLOG.ERROR,'%s %s'%sys.exc_info()[:2]) |
logger('OSAS_Root (addFileToDollection)',logging.ERROR,'%s %s'%sys.exc_info()[:2]) |
return URL |
return URL |
return urllib.urlopen(URL).read() |
return urllib.urlopen(URL).read() |
|
|
Line 139 class OSAS_add_contextData(Folder):
|
Line 146 class OSAS_add_contextData(Folder):
|
|
|
index_html=addContextData |
index_html=addContextData |
|
|
def addContextData2(self,path,collection,label,description,content_type,responsible,weight,thumb="",streamingfile="",rawfile="",credits=None): |
def addContextData2(self,path,collection,label,description,content_type,responsible,weight,thumb="",streamingfile="",rawfile="",lowresfile="",credits=None): |
"""Hinzufuegen der Resource""" |
"""Hinzufuegen der Resource""" |
splitted=path.split("/") |
splitted=path.split("/") |
#print "BLU" |
#print "BLU" |
Line 149 class OSAS_add_contextData(Folder):
|
Line 156 class OSAS_add_contextData(Folder):
|
|
|
#link=TOBEDONE" |
#link=TOBEDONE" |
"""Hinzufuegen der Ressource""" |
"""Hinzufuegen der Ressource""" |
|
|
gifPath=path.replace("/mpiwg/online/","") |
gifPath=path.replace("/mpiwg/online/","") |
rawPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
rawPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
|
lowresPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
|
|
thumbUrl="http://einst3.mpiwg-berlin.mpg.de/"+gifPath+"/"+thumb |
thumbUrl="http://einst3.mpiwg-berlin.mpg.de/"+gifPath+"/"+thumb |
link="rtsp://einst1.mpiwg-berlin.mpg.de/"+gifPath+"/"+streamingfile |
link="rtsp://einst1.mpiwg-berlin.mpg.de/"+gifPath+"/"+streamingfile |
rawFile="file:///Volumes/einstein_movies/"+rawPath+"/"+rawfile |
rawFile="file:///Volumes/einstein_movies/"+rawPath+"/"+rawfile |
|
lowresFile="rtsp://einst1.mpiwg-berlin.mpg.de/"+gifPath+"/"+lowresfile |
|
|
|
|
params=urllib.urlencode({'id':id,'title':title,'link':link,'thumbUrl':thumbUrl,'rawFile':rawFile,'label':label,'description':description,'contentType':content_type,'responsible':responsible,'weight':weight,'credits':credits,'metalink':metalink}) |
params=urllib.urlencode({'id':id,'title':title,'link':link,'thumbUrl':thumbUrl,'rawFile':rawFile,'label':label,'description':description,'contentType':content_type,'responsible':responsible,'weight':weight,'credits':credits,'metalink':metalink}) |
Line 161 class OSAS_add_contextData(Folder):
|
Line 172 class OSAS_add_contextData(Folder):
|
|
|
try: |
try: |
server=xmlrpclib.Server(collection,allow_none=True) |
server=xmlrpclib.Server(collection,allow_none=True) |
retStr=server.addMovie(id,title,label,description,content_type,responsible,link,thumbUrl,rawFile,metalink,weight,credits) |
retStr=server.addMovie(id,title,label,description,content_type,responsible,link,thumbUrl,rawFile,lowresFile,metalink,weight,credits) |
except: |
except: |
zLOG.LOG('OSAS_Root (addFileToDollection2)',zLOG.ERROR,'%s %s'%sys.exc_info()[:2]) |
logger('OSAS_Root (addFileToDollection2)',logging.ERROR,'%s %s'%sys.exc_info()[:2]) |
return "An Error occured adding the resource\n", collection,params |
return "An Error occured adding the resource\n", collection,params |
|
|
#print "added" |
#print "added" |
Line 414 class OSAS_root(Folder,Implicit):
|
Line 425 class OSAS_root(Folder,Implicit):
|
|
|
dom=self.validateIndexMeta(xmlneu) |
dom=self.validateIndexMeta(xmlneu) |
if not dom: |
if not dom: |
zLOG.LOG('OSAS_Root (downloadExternalXML)',zLOG.ERROR,'cannot parse: %s', xml_url) |
logger('OSAS_Root (downloadExternalXML)',logging.ERROR,'cannot parse: %s', xml_url) |
return "error" |
return "error" |
|
|
|
|