version 1.92, 2008/09/08 19:36:52
|
version 1.97, 2009/04/14 16:31:27
|
Line 27 def logger(txt,method,txt2):
|
Line 27 def logger(txt,method,txt2):
|
|
|
displayTypes = ['ZSQLExtendFolder','ZSQLBibliography','ECHO_group','ECHO_collection','ECHO_resource','ECHO_link','ECHO_sqlElement','ECHO_pageTemplate','ECHO_externalLink','ImageCollectionIFrame','VLP_resource','VLP_essay','ECHO_ZCatalogElement','ImageCollection','versionedFileFolder','extVersionedFileFolder','ECHO_movie'] |
displayTypes = ['ZSQLExtendFolder','ZSQLBibliography','ECHO_group','ECHO_collection','ECHO_resource','ECHO_link','ECHO_sqlElement','ECHO_pageTemplate','ECHO_externalLink','ImageCollectionIFrame','VLP_resource','VLP_essay','ECHO_ZCatalogElement','ImageCollection','versionedFileFolder','extVersionedFileFolder','ECHO_movie'] |
|
|
|
def normalizeCt(str): |
|
"""normalizes content_type""" |
|
#str= str.replace(" ","_") |
|
return str.replace("-"," ").lower() |
|
|
#decode and compress for xmlrpc communication with OSAS_server |
#decode and compress for xmlrpc communication with OSAS_server |
|
|
Line 84 class ECHO_basis:
|
Line 88 class ECHO_basis:
|
management_page_charset="utf-8" |
management_page_charset="utf-8" |
isVisible = True |
isVisible = True |
|
|
|
# Managment for the PID |
|
def setPID(self,pid): |
|
"""set the pid""" |
|
logging.debug(self.getID()+" PID set to "+pid) |
|
self.pid=pid |
|
return True |
|
|
|
def getPID(self): |
|
"""get the pid""" |
|
|
|
pid =getattr(self,'pid',None) |
|
|
|
if pid == self.getParentPID(): |
|
return None |
|
else: |
|
return pid |
|
|
|
|
|
def getParentPID(self): |
|
"""get the PID of the parent""" |
|
parent = self.aq_parent |
|
|
|
pidF = getattr(parent,'getPID',None) |
|
|
|
if pidF is None: |
|
return None |
|
|
|
else: |
|
return pidF() |
|
|
def unicodify(self, s): |
def unicodify(self, s): |
"""return unicode object for string (utf-8 or latin1) or unicode object s""" |
"""return unicode object for string (utf-8 or latin1) or unicode object s""" |
Line 109 class ECHO_basis:
|
Line 142 class ECHO_basis:
|
def showRDF(self): |
def showRDF(self): |
"""showrdf""" |
"""showrdf""" |
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') |
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') |
ret="""<?xml version="1.0" encoding="utf-8"?>\n<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ECHONAVIGATION="http://www.echo.eu/rdf#">\n""" |
ret="""<?xml version="1.0" encoding="utf-8"?>\n<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ECHONAVIGATION="http://www.echo.eu/rdf#" |
|
xmlns:MPIWG="http://www.mpiwg-berlin.mpg.de/ns/mpiwg">\n""" |
|
|
ret+=self.getRDF(urn="echo:collectionroot")+"\n" |
ret+=self.getRDF(urn="echo:collectionroot")+"\n" |
|
|
Line 172 class ECHO_basis:
|
Line 206 class ECHO_basis:
|
nurn=self.absolute_url()+'/showMetaDataXML' |
nurn=self.absolute_url()+'/showMetaDataXML' |
ret+=getRDFDescription(self,self.absolute_url()+'/showMetaDataXML',urn=nurn,nameDef="Metadata",typeName="ECHO_metaData") |
ret+=getRDFDescription(self,self.absolute_url()+'/showMetaDataXML',urn=nurn,nameDef="Metadata",typeName="ECHO_metaData") |
|
|
return ret |
|
|
|
|
return ret |
def content_html_XMLRpc(self): |
def content_html_XMLRpc(self): |
"""xml_rpc_version""" |
"""xml_rpc_version""" |
return encodeRPC(self.content_html()) |
return encodeRPC(self.content_html()) |
Line 207 class ECHO_basis:
|
Line 241 class ECHO_basis:
|
return self.isVisible |
return self.isVisible |
return True |
return True |
|
|
|
def getDescription(self): |
|
"""get content of description field""" |
|
|
|
|
|
return self.unicodify(getattr(self,'description','')); |
|
|
def getTitle(self): |
def getTitle(self): |
"""title""" |
"""title""" |
if hasattr(self,'getLanguage'): |
if hasattr(self,'getLanguage'): |
Line 782 def reloadMetaDataFromStorage(self,RESPO
|
Line 822 def reloadMetaDataFromStorage(self,RESPO
|
|
|
return ret |
return ret |
|
|
def getRDFDescription(self,linkURL,urn=None,nameDef=None,typeName=None): |
def getRDFDescription(self,linkURL,urn=None,nameDef=None,typeName=None,ap=""): |
"""rdf""" |
"""rdf""" |
|
|
ret="" |
ret="" |
Line 792 def getRDFDescription(self,linkURL,urn=N
|
Line 832 def getRDFDescription(self,linkURL,urn=N
|
clickable="""<ECHONAVIGATION:linkClickable>%s</ECHONAVIGATION:linkClickable>""" |
clickable="""<ECHONAVIGATION:linkClickable>%s</ECHONAVIGATION:linkClickable>""" |
#link="""<ECHONAVIGATION:link RDF:about="%s"/>""" |
#link="""<ECHONAVIGATION:link RDF:about="%s"/>""" |
type="""<ECHONAVIGATION:type>%s</ECHONAVIGATION:type>""" |
type="""<ECHONAVIGATION:type>%s</ECHONAVIGATION:type>""" |
|
|
#xlink="""<ECHONAVIGATION:xlink xlink:href="%s"/>""" |
#xlink="""<ECHONAVIGATION:xlink xlink:href="%s"/>""" |
|
|
|
if ap=="": |
|
ap2="" |
|
else: |
|
ap2 = """<MPIWG:archive-path>%s</MPIWG:archive-path>"""%ap |
|
|
if not urn: |
if not urn: |
#urn="urn:"+re.sub('/',':',self.absolute_url()) |
#urn="urn:"+re.sub('/',':',self.absolute_url()) |
urn=self.absolute_url() |
urn=self.absolute_url() |
Line 819 def getRDFDescription(self,linkURL,urn=N
|
Line 866 def getRDFDescription(self,linkURL,urn=N
|
else: |
else: |
type2=type%typeName |
type2=type%typeName |
|
|
|
|
#ret=about2+"\n"+name2+"\n"+link2+"\n"+type2+"\n"+clickable2+"\n</RDF:Description>" |
#ret=about2+"\n"+name2+"\n"+link2+"\n"+type2+"\n"+clickable2+"\n</RDF:Description>" |
ret=about2+"\n"+name2+"\n"+type2+"\n"+clickable2+"\n</RDF:Description>" |
ret=about2+"\n"+name2+"\n"+type2+"\n"+clickable2+"\n"+ap2+"\n</RDF:Description>" |
return ret |
return ret |
|
|
def getCopyrightsFromForm(self,argv): |
def getCopyrightsFromForm(self,argv): |