version 1.160, 2004/08/05 13:51:32
|
version 1.162, 2004/08/09 10:10:56
|
Line 48 import xml.dom.minidom
|
Line 48 import xml.dom.minidom
|
from ECHO_graphicalOverview import javaHandler,javaScriptMain |
from ECHO_graphicalOverview import javaHandler,javaScriptMain |
import ECHO_helpers |
import ECHO_helpers |
|
|
|
#regexp for extracting elements from xml |
|
patternTXT=r"<\s*txt.*?>(.*?)</txt>" |
|
regexpTXT = re.compile(patternTXT, re.IGNORECASE + re.DOTALL) |
|
patternPage=r"<\s*page.*?>(.*?)</page>" |
|
regexpPage = re.compile(patternPage, re.IGNORECASE + re.DOTALL) |
|
|
|
|
def ECHO_rerenderLinksMD(self,obj=None,types=['title','label']): |
def ECHO_rerenderLinksMD(self,obj=None,types=['title','label']): |
"""Rerender all Links""" |
"""Rerender all Links""" |
ret="" |
ret="" |
Line 1724 class ECHO_collection(Folder, Persistent
|
Line 1731 class ECHO_collection(Folder, Persistent
|
return ret |
return ret |
|
|
|
|
|
|
def changeLabels(self): |
def changeLabels(self): |
"""change form""" |
"""change form""" |
pt=PageTemplateFile('Products/ECHO_content/zpt/changeLabelsForm').__of__(self) |
pt=PageTemplateFile('Products/ECHO_content/zpt/changeLabelsForm').__of__(self) |
Line 1736 class ECHO_collection(Folder, Persistent
|
Line 1744 class ECHO_collection(Folder, Persistent
|
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
|
def changeMetaDataLinks(self): |
|
"""change form""" |
|
pt=PageTemplateFile('Products/ECHO_content/zpt/changeMetaDataLinkForm').__of__(self) |
|
pt.content_type="text/html" |
|
return pt() |
def changeAccessRightsCollection(self): |
def changeAccessRightsCollection(self): |
"""change""" |
"""change""" |
ret="" |
ret="" |
Line 1751 class ECHO_collection(Folder, Persistent
|
Line 1764 class ECHO_collection(Folder, Persistent
|
"""not""" |
"""not""" |
return ret |
return ret |
|
|
|
def changeMetaDataLinkInCollection(self): |
|
"""change all lables of a collection""" |
|
ret="" |
|
argv=self.REQUEST.form |
|
|
|
resources=self.ZopeFind(self,obj_metatypes=['ECHO_resource']) |
|
for resource in resources: |
|
|
|
try: |
|
ret+=resource[1].getId()+" "+argv[resource[1].getId()]+"</br>" |
|
resource[1].metalink=argv[resource[1].getId()][0:] |
|
except: |
|
"""not""" |
|
return ret |
|
|
def changeLabelsInCollection(self): |
def changeLabelsInCollection(self): |
"""change all lables of a collection""" |
"""change all lables of a collection""" |
ret="" |
ret="" |
Line 3030 class ECHO_root(Folder,Persistent,Implic
|
Line 3058 class ECHO_root(Folder,Persistent,Implic
|
link.setAttribute("href",self.aq_parent.absolute_url()+"/vlp_coll?id="+ref) |
link.setAttribute("href",self.aq_parent.absolute_url()+"/vlp_coll?id="+ref) |
|
|
newxml=dom.toxml('utf-8') |
newxml=dom.toxml('utf-8') |
match=re.sub(r'<\?xml version=\"1.0\" encoding=\"utf-8\"\?>\n<txt>','',newxml) |
|
match=re.sub(r'</txt>','',match) |
|
|
|
return match |
retStr=regexpTXT.search(newxml) |
|
|
|
return retStr.group(1) |
|
|
|
|
return "" |
return "" |
|
|
Line 3052 class ECHO_root(Folder,Persistent,Implic
|
Line 3081 class ECHO_root(Folder,Persistent,Implic
|
if self.checkRef(ref): |
if self.checkRef(ref): |
link.setAttribute("href",self.aq_parent.absolute_url()+"/vlp_coll?id="+ref) |
link.setAttribute("href",self.aq_parent.absolute_url()+"/vlp_coll?id="+ref) |
|
|
return dom.toxml('utf-8') |
str= dom.toxml('utf-8') |
|
#print str |
|
retStr=regexpPage.search(str) |
|
|
|
return retStr.group(1) |
return "" |
return "" |
|
|
def checkRef(self,ref): |
def checkRef(self,ref): |