--- ECHO_content/VLPExtension.py 2005/10/13 15:59:42 1.50 +++ ECHO_content/VLPExtension.py 2007/01/08 17:57:23 1.57 @@ -230,6 +230,7 @@ class VLP_essay(Folder): pages.sort(sortFind) #print str(pages[int(pagenum)][1]()) + if pages[int(pagenum)-1][1].meta_type=='File': #return makeXML(str(pages[int(pagenum)-1][1])) @@ -346,6 +347,36 @@ class VLP_subcollection(ECHO_collection) meta_type="VLP_subcollection" + def getVLPSubcollectionToc(self,type): + + #different ordering depending on the type + if(type == "(Collection)"): + sort= "shortreference" + else: + sort = "startpages" + + #content of journals also displayed if not online + + if (type == "(JournalVolume)"): + online ="" + else: + online ="AND online = 1" + sort=self.collectionSort(type) + + item = [x for x in self.ZSQLSimpleSearch("""SELECT * FROM vl_literature + WHERE volumeid ~ '%s\\M' """%self.getId() + + """ %s AND not referenceType='%s' """%(online,type) + + """ORDER BY """ + sort)] + + tocItem = [x for x in self.ZSQLSimpleSearch("""SELECT * FROM vl_literature + WHERE reference = '%s' """%self.getId() + + """AND online = 1 AND referenceType='%s' """%type + + """ORDER BY """ + sort)] + + + + return tocItem+item + def checkForFrontMatter(self,item): """Teste ob Frontmatter exists""" if not item==self.getId(): @@ -395,10 +426,11 @@ class VLP_collection(ECHO_collection): def generateSubCollections(self,errorsTXT=""): """erzeuge subcollectionen""" - founds=self.ZSQLSimpleSearch("select * from vl_literature where referencetype in ('(Book)','(Collection)','(Journal)')") + founds=self.ZSQLSimpleSearch("select * from vl_literature where referencetype in ('(Edited Book)','(Book)','(Collection)','(JournalVolume)','(Generic Container)'") self.REQUEST.RESPONSE.write("

Create Subcollections

\n") for found in founds: + try: foundCol=self.ZopeFind(self,obj_ids=[found.reference]) if foundCol: @@ -444,6 +476,7 @@ class VLP_collection(ECHO_collection): files=os.listdir(self.vlp_basis) errorsTXT+="

New Ressources

" + for fileName in files: if fileName[0:3]=="lit": @@ -813,7 +846,7 @@ class VLP_resource(ECHO_resource,Cacheab urlTmp=self.absolute_url()+"/index.xml" if self.ZCacheable_isCachingEnabled(): - + result = self.ZCacheable_get(view_name=urlTmp) if result is not None: # Got a cached value. @@ -822,7 +855,7 @@ class VLP_resource(ECHO_resource,Cacheab pagelist=[] if not url: - + xmlTxt=getattr(self,'index.xml')() dom=xml.dom.minidom.parseString(xmlTxt) else: