--- OSAS/OSA_system/OSAS_addfiles.py 2004/04/14 21:26:23 1.27 +++ OSAS/OSA_system/OSAS_addfiles.py 2004/04/15 12:56:41 1.28 @@ -218,7 +218,6 @@ class OSAS_add_contextData(Folder): begin="" end="" if self.depth==1: - print "hi" begin="" end="" @@ -468,7 +467,7 @@ class OSAS_combineTextImage(Folder): filelanguage="" self.REQUEST.SESSION['isolist']=OSAS_add.getISO() - print "DD",self.REQUEST.SESSION['isolist'] + tmp=self.REQUEST.SESSION['isolist'].keys() tmp.sort() self.REQUEST.SESSION['isolistsort']=tmp @@ -485,13 +484,13 @@ class OSAS_combineTextImage(Folder): def getProjects(self,obj_ids=None): """Get the Project title for configuration""" ret=[] - print "HI" + try: projects=self.ZopeFind(self.projects,obj_metatypes=['OSAS_project'],obj_ids=obj_ids)#assumes projects folder somewhere in the hierarchie. - print "pr" + for project in projects: ret.append((project[1].title,project[0],project[1])) - print ret + return ret except: @@ -504,7 +503,7 @@ class OSAS_combineTextImage(Folder): dom=xml.dom.minidom.parse(path+"/index.meta") node=dom.getElementsByTagName('texttool')[0] #getNode subnode=node.getElementsByTagName(name)[0] - print getText(subnode.childNodes) + return getText(subnode.childNodes) except: return default @@ -515,9 +514,16 @@ class OSAS_combineTextImage(Folder): OSAS_add.combineTextImage2(self,path) # Add images splitted=path.split("/") linkPath=splitted[len(splitted)-1] - linkViewerEnvironment="http://nausikaa2.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.x.cgi?dir=%s&step=thumb" % linkPath - self.REQUEST.SESSION['linkViewerEnvironment']=linkViewerEnvironment + linkViewerEnvironmentImages="http://nausikaa2.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.x.cgi?dir=%s&step=thumb" % linkPath + linkViewerEnvironmentOnlyText="http://nausikaa2.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.x.cgi?dir=%s&step=textonly" % linkPath + if self.REQUEST.has_key('image'): # bilder vorhanden + linkViewerEnvironment=linkViewerEnvironmentImages + else: + linkViewerEnvironment=linkViewerEnvironmentOnlyText + + self.REQUEST.SESSION['linkViewerEnvironment']=linkViewerEnvironment + writeToContext(path,linkViewerEnvironment,"ECHO standard environment",unique="yes") pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_combineTextImageFinal.zpt').__of__(self) @@ -544,7 +550,7 @@ def writeToContext(path,link,description nameTag=getText(context.getElementsByTagName('name')[0].childNodes) linkTag=getText(context.getElementsByTagName('link')[0].childNodes) - print "unique",context,nameTag,description,linkTag,link + linkTag=re.sub("\:86","",linkTag) # alter port 86 gleich ohne port nummer (hack) if (nameTag==description) and (linkTag==link): node.removeChild(context).unlink()