version 1.36, 2004/08/19 19:01:17
|
version 1.37, 2004/10/04 12:57:03
|
Line 76 class OSAS_add_Document(Folder):
|
Line 76 class OSAS_add_Document(Folder):
|
|
|
def add4(self): |
def add4(self): |
"""Applet""" |
"""Applet""" |
|
|
return OSAS_add.add4(self) |
return OSAS_add.add4(self) |
|
|
def add5(self): |
def add5(self): |
Line 250 class OSAS_add_contextData(Folder):
|
Line 251 class OSAS_add_contextData(Folder):
|
def XmlToTree(self,URL): |
def XmlToTree(self,URL): |
"""Collection XML to Tree""" |
"""Collection XML to Tree""" |
|
|
|
|
class requestHandler(ContentHandler): |
class requestHandler(ContentHandler): |
def __init__(self): |
def __init__(self): |
self.depth=0 |
self.depth=0 |
Line 282 class OSAS_add_contextData(Folder):
|
Line 282 class OSAS_add_contextData(Folder):
|
|
|
parser.parse(urllib.urlopen(URL)) |
parser.parse(urllib.urlopen(URL)) |
return curHandler.retStr |
return curHandler.retStr |
|
|
except: |
except: |
return URL |
return URL |
return urllib.urlopen(URL).read() |
return urllib.urlopen(URL).read() |
Line 302 class OSAS_add_contextData(Folder):
|
Line 303 class OSAS_add_contextData(Folder):
|
|
|
def startElement(self,name,attrs): |
def startElement(self,name,attrs): |
if name=="partner": |
if name=="partner": |
self.ret.append((attrs.get('id'),attrs.get('title'))) |
self.ret.append((attrs.get('id'),attrs.get('title').encode('utf-8'))) |
|
|
|
|
URL+="/getPartnersXML" |
URL+="/getPartnersXML" |
|
|
try: |
|
|
|
parser=make_parser() |
parser=make_parser() |
curHandler=requestHandler() |
curHandler=requestHandler() |
parser.setContentHandler(curHandler) |
parser.setContentHandler(curHandler) |
|
|
parser.parse(urllib.urlopen(URL)) |
parser.parse(urllib.urlopen(URL)) |
|
try: |
|
|
return curHandler.ret |
return curHandler.ret |
except: |
except: |
return [("",URL)] |
return [("",URL)] |
Line 346 class OSAS_add_contextData(Folder):
|
Line 345 class OSAS_add_contextData(Folder):
|
metalink=self.REQUEST['SERVER_URL']+path+"/index.meta" |
metalink=self.REQUEST['SERVER_URL']+path+"/index.meta" |
|
|
#link=TOBEDONE" |
#link=TOBEDONE" |
"""Hinzufügen der Ressource""" |
"""Hinzufuegen der Ressource""" |
|
|
params=urllib.urlencode({'id':id,'title':title,'link':link,'label':label,'description':description,'contentType':content_type,'responsible':responsible,'weight':weight,'credits':credits,'metalink':metalink}) |
params=urllib.urlencode({'id':id,'title':title,'link':link,'label':label,'description':description,'contentType':content_type,'responsible':responsible,'weight':weight,'credits':credits,'metalink':metalink}) |
|
|
print params |
|
|
|
retStr=urllib.urlopen(collection+"/addResource",params).read() |
|
|
|
|
retStr=urllib.urlopen(collection+"/addResource",params).read() |
|
#print "added" |
if not retStr: |
if not retStr: |
return "An Error occured adding the resource\n" |
return "An Error occured adding the resource\n", collection,params |
|
|
|
|
print urllib.urlopen(collection+"/"+id+"/copyIndex_meta2echo_resource").read() |
#print collection+"/"+id+"/copyIndex_meta2echo_resource" |
print urllib.urlopen(collection+"/"+id+"/generate_label").read() |
|
print urllib.urlopen(collection+"/"+id+"/generate_title").read() |
|
|
|
|
urllib.urlopen(collection+"/"+id+"/copyIndex_meta2echo_resource").read() |
|
#print "copy2res" |
|
urllib.urlopen(collection+"/"+id+"/generate_label").read() |
|
#print "label" |
|
urllib.urlopen(collection+"/"+id+"/generate_title").read() |
|
#print "title" |
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+( |