--- ECHO_content/ECHO_collection.py 2007/03/09 17:57:13 1.286 +++ ECHO_content/ECHO_collection.py 2007/07/19 14:13:13 1.290 @@ -200,6 +200,8 @@ class ECHO_locale(ZopePageTemplate): self.title=title self.label=label if text: + if content_type is None: + content_type = self.content_type self.pt_edit(text, content_type) self.id=id @@ -218,6 +220,8 @@ class ECHO_locale(ZopePageTemplate): self.title=title self.label=label if not text is None: + if content_type is None: + content_type = self.content_type self.pt_edit(text, content_type) if RESPONSE is not None: @@ -307,6 +311,8 @@ class ECHO_layoutTemplate(ZopePageTempla if text is None: self._default_content_fn = os.path.join(package_home(globals()),'zpt','ECHO_%s_template_standard.zpt'%EchoType) text = open(self._default_content_fn).read() + if content_type is None: + content_type = self.content_type self.pt_edit(text, content_type) @@ -1177,8 +1183,26 @@ class ECHO_resource(CatalogAware,Folder, only if metalink is set, otherwise it gives false """ + texterUrl="http://nausikaa2.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=/" + vl,msg=self.checkValidityOfMetaLink() + if not vl: #ungueltiger link, versuche neuen + newStr=re.match(".*/mpiwg/online/(.*)",self.metalink) # suche pfad hinter /mpiwg/online + oldLink=self.metalink + + if newStr: + self.metalink=texterUrl+newStr.group(1) + vl,msg=self.checkValidityOfMetaLink() + else: + logging.error("change Viewer XX(mew Metadatafile) %s"%self.metalink) + vl=False + + if not vl: # geht immer noch nicht, dann setzte wieder zurueck + self.metaLink=oldLink + + logging.info("change Viewer (mew Metadatafile) %s"%self.metalink) + if vl: self.newViewer=newViewer return vl,msg @@ -1981,7 +2005,7 @@ class ECHO_link(ECHO_externalLink): params['backLink']=self.aq_parent.absolute_url() params['startLink']=splitted[0]+"?"+urllib.urlencode(params) - + return self.REQUEST.RESPONSE.redirect(splitted[0]+"?"+urllib.urlencode(params)) else: return "" @@ -2146,16 +2170,16 @@ class ECHO_collection(CatalogAware, Fold if obj.meta_type=="ECHO_mapText": if splitted[1]=="en": - obj.locale_en.pt_edit(REQUEST.form[key],None) + obj.locale_en.pt_edit(REQUEST.form[key],obj.locale_en.content_type) else: - obj.pt_edit(REQUEST.form[key],None) + obj.pt_edit(REQUEST.form[key],obj.content_type) else: text=obj.ZopeFind(obj,obj_metatypes=['ECHO_mapText']) if splitted[1]=="en": - text[0][1].locale_en.pt_edit(REQUEST.form[key],None) + text[0][1].locale_en.pt_edit(REQUEST.form[key],text[0][1].locale_en.content_type) else: - text[0][1].pt_edit(REQUEST.form[key],None) + text[0][1].pt_edit(REQUEST.form[key],text[0][1].content_type) if RESPONSE is not None: RESPONSE.redirect('manage_main') @@ -2612,9 +2636,9 @@ class ECHO_collection(CatalogAware, Fold ret="""""" return ret+""+getCollection(self,pwstr=pwstr)+"" - def createAllJSAreas(self): + def createAllJSAreas(self,mapColTypes=None): """create area calls for JavaScript""" - areas = self.getAllMapAreas() + areas = self.getAllMapAreas(mapColTypes=mapColTypes) return self.createJSAreas(areas) @@ -2839,9 +2863,11 @@ class ECHO_collection(CatalogAware, Fold """javascript""" return sendFile(self, 'js/hl_add.js', 'text/plain') - def getAllMapAreas(self,mapColTypes=['ECHO_collection','ECHO_resource','ECHO_link','ECHO_externalLink']): + def getAllMapAreas(self,mapColTypes=None): """Give list of coordinates""" - + if mapColTypes is None: + mapColTypes=['ECHO_collection','ECHO_resource','ECHO_link','ECHO_externalLink'] + areas=[] for entry in self.getSubCols(subColTypes=mapColTypes): object=entry @@ -4114,6 +4140,8 @@ class ECHO_linkList(ZopePageTemplate,ECH self.ZBindings_edit(self._default_bindings) if text is None: text = '' + if content_type is None: + content_type = self.content_type self.pt_edit(text, contentType)