version 1.40, 2005/04/27 13:17:45
|
version 1.44, 2006/02/14 16:43:49
|
Line 19 from Globals import package_home
|
Line 19 from Globals import package_home
|
|
|
from xml.sax import make_parser |
from xml.sax import make_parser |
from xml.sax.handler import ContentHandler |
from xml.sax.handler import ContentHandler |
|
import sys |
|
import zLOG |
|
|
def spaces(depth): |
def spaces(depth): |
"""needed in XMLtoTree""" |
"""needed in XMLtoTree""" |
Line 325 class OSAS_add_contextData(Folder):
|
Line 327 class OSAS_add_contextData(Folder):
|
|
|
def addContextData(self,path): |
def addContextData(self,path): |
"""Hinzufuegen zu einer Sammlung""" |
"""Hinzufuegen zu einer Sammlung""" |
|
|
|
server=getattr(self,'serverUrl',self.REQUEST['SERVER_URL']) |
|
if path[0]=="/": #strip leading slash |
|
urlpath=path[1:] |
|
else: |
|
urlpath=path |
try: |
try: |
urllib.urlopen(self.REQUEST['SERVER_URL']+path+"/index.meta") |
urllib.urlopen(server+"/"+urlpath+"/index.meta") |
|
|
except: |
except: |
return self.REQUEST['SERVER_URL']+path+"/index.meta file has to exist!" |
zLOG.LOG("OSAS_addfiles (addContextData)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
|
return server+"/"+urlpath+"/index.meta file has to exist!" |
|
|
links=[(path,'standard storage')] |
links=[(path,'standard storage')] |
|
|
Line 347 class OSAS_add_contextData(Folder):
|
Line 356 class OSAS_add_contextData(Folder):
|
#print "BLU" |
#print "BLU" |
id=splitted[len(splitted)-1] |
id=splitted[len(splitted)-1] |
title=splitted[len(splitted)-1] |
title=splitted[len(splitted)-1] |
metalink=self.REQUEST['SERVER_URL']+path+"/index.meta" |
server=getattr(self,'serverUrl',self.REQUEST['SERVER_URL']) |
|
if path[0]=="/": #strip leading slash |
|
urlpath=path[1:] |
|
else: |
|
urlpath=path |
|
|
|
|
|
metalink=server+"/"+urlpath+"/index.meta" |
|
|
#link=TOBEDONE" |
#link=TOBEDONE" |
"""Hinzufuegen der Ressource""" |
"""Hinzufuegen der Ressource""" |
Line 368 class OSAS_add_contextData(Folder):
|
Line 384 class OSAS_add_contextData(Folder):
|
|
|
urllib.urlopen(collection+"/"+id+"/copyIndex_meta2echo_resource").read() |
urllib.urlopen(collection+"/"+id+"/copyIndex_meta2echo_resource").read() |
#print "copy2res" |
#print "copy2res" |
|
try: |
urllib.urlopen(collection+"/"+id+"/generate_label").read() |
urllib.urlopen(collection+"/"+id+"/generate_label").read() |
#print "label" |
except: |
|
zLOG.LOG("OSAS_addfiles (addContextData2,label not generated)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
|
try: |
urllib.urlopen(collection+"/"+id+"/generate_title").read() |
urllib.urlopen(collection+"/"+id+"/generate_title").read() |
#print "title" |
except: |
|
zLOG.LOG("OSAS_addfiles (addContextData2,title not generated)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2]) |
|
|
|
|
return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path) |
return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path) |
|
|
manage_options = Folder.manage_options+( |
manage_options = Folder.manage_options+( |
Line 385 class OSAS_add_contextData(Folder):
|
Line 407 class OSAS_add_contextData(Folder):
|
return pt() |
return pt() |
|
|
|
|
def change_OSAS_add_contextData(self,collection,pwstr=None,RESPONSE=None): |
def change_OSAS_add_contextData(self,collection,serverUrl,pwstr=None,RESPONSE=None): |
"""Change""" |
"""Change""" |
self.pwstr=pwstr |
self.pwstr=pwstr |
self.collection=collection |
self.collection=collection |
|
self.serverUrl=serverUrl |
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|