--- ECHO_content/ECHO_collection.py 2004/06/22 08:49:00 1.124 +++ ECHO_content/ECHO_collection.py 2004/06/24 12:23:05 1.129 @@ -484,28 +484,42 @@ class ECHO_resource(Folder,Persistent): getSubCols = ECHO_helpers.getSubCols + def setStartPageForm(self): + """Form for changing the startpage""" + + + pt=PageTemplateFile('Products/ECHO_content/zpt/ChangeECHO_resourceStartPage.zpt').__of__(self) + pt.content_type="text/html" + return pt() + + def setStartPage(self,startpage=None,RESPONSE=None): """set start page, if no startpage defined use the generic one of the resource""" - if not startpage: + if (not (type(startpage)==StringType)) and ("__generic" in startpage): # checke ob generic in der liste startpage=self.absolute_url()+"/startpage_html" - + + if (not startpage) or (startpage=="__generic"): + startpage=self.absolute_url()+"/startpage_html" params="startpage=%s"%startpage - urllib.urlopen('http://xserve02.mpiwg-berlin.mpg.de:18880/echo_nav/storage/downloadExternalXML?index_meta_url=%s&xml_url=%s'%(self.metalink,self.absolute_url()+'/newMetaXML'+urllib.quote('?'+params))).read() - + + path=self.metalink + path=re.sub(self.REQUEST['SERVER_URL'],'',path) + path=re.sub('http://'+self.REQUEST['HTTP_HOST'],'',path) + path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',path) # falls foxridge als server path=re.sub('/index.meta','',path) - print urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() + urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() if RESPONSE is not None: RESPONSE.redirect('manage_main') @@ -540,7 +554,7 @@ class ECHO_resource(Folder,Persistent): paramList=['project','startpage','xslt','thumbtemplate','topbar','digiLibTemplate'] - #print writeMetadata(self.metalink,self.metaDataHash,project,startpage,xslt,thumbtemplate,topbar,digiLibTemplate) + writeMetadata(self.metalink,self.metaDataHash,project,None,xslt,thumbtemplate,topbar,digiLibTemplate) params="project=%s&xslt=%s&thumbtemplate=%s&topbar=%s&digiLibTemplate=%s"%(project,xslt,thumbtemplate,topbar,digiLibTemplate) @@ -550,13 +564,19 @@ class ECHO_resource(Folder,Persistent): # hack Pfad auf die Dokumente path=self.metalink - path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server - path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',path) # falls foxridge als server + path=re.sub('/index.meta','',path) + path=re.sub(self.REQUEST['SERVER_URL'],'',path) + path=re.sub('http://'+self.REQUEST['HTTP_HOST'],'',path) + + path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server + path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server + path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',path) # falls foxridge als server + - print urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() + return urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() if RESPONSE is not None: RESPONSE.redirect('manage_main') @@ -602,10 +622,10 @@ class ECHO_resource(Folder,Persistent): return "no fulltext available" def getCopyrightsHTML(self): - """gib (link auf copyright notiz, mediatyp, institution, copyrightType, label von copyrightType) aus""" + """gib (link auf copyright link, mediatyp, institution, copyrightType, label von copyrightType) aus""" - if hasattr(self,'copyrightModell'): - obj=self.copyrightModell + if hasattr(self,'copyrightModel'): + obj=self.copyrightModel else: return "ERROR" @@ -621,12 +641,12 @@ class ECHO_resource(Folder,Persistent): url=copyrightTypeObj.url if url!='': - ret.append(("""%s"""%(url,label),copyright[0],copyright[1],copyright[2],label)) + ret.append((url,copyright[0],copyright[1],copyright[2],label)) else: if hasattr(copyrightTypeObj, 'copyright.html'): - ret.append(("""%s"""%(link,copyright[1],label),copyright[0],copyright[1],copyright[2],label)) + ret.append(("""%s?partner=%s"""%(link,copyright[1]),copyright[0],copyright[1],copyright[2],label)) else: - ret.append((label,copyright[0],copyright[1],copyright[2],label)) + ret.append(('empty',copyright[0],copyright[1],copyright[2],label)) except: """nothing""" @@ -860,6 +880,7 @@ class ECHO_resource(Folder,Persistent): {'label':'Add coords','action':'ECHO_graphicEntry'}, {'label':'Sync Metadata','action':'ECHO_getResourceMD'}, {'label':'Change TemplateSets','action':'changeViewerTemplateSetForm'}, + {'label':'set/change startpage','action':'setStartPageForm'}, ) def getOverview(self):