--- ECHO_content/VLPExtension.py 2008/10/08 08:35:20 1.78 +++ ECHO_content/VLPExtension.py 2008/10/08 10:18:04 1.79 @@ -565,23 +565,24 @@ class VLP_collection(ECHO_collection,Acq for found in founds: try: litid = str(found.reference) - foundCol=self.ZopeFind(self,obj_ids=[litid]) + foundCol=self.findObjFromLitName(litid) + #foundCol=self.ZopeFind(self,obj_ids=[litid]) if foundCol: - col = foundCol[0][1] - logging.debug("generateSubCollections: subcollection %s exists (%s)"%(col.getId(),found.reference)) + col = foundCol + logging.debug("generateSubCollections: subcollection %s exists (%s)"%(repr(col),found.reference)) if (col.title != found.titlerefdisplay) or (col.label != found.titlerefdisplay): # subcollection seems to have changed logging.debug("generateSubCollections: subcollection has changed, recreating!") - self.manage_delObjects([foundCol[0][0]]) - manage_addVLP_subCollection(self,litid,found.titlerefdisplay,found.titlerefdisplay) + col.aq_parent.manage_delObjects([col.getId()]) + manage_addVLP_subCollection(self.getOrCreateFolderForFile(litid),litid,found.titlerefdisplay,found.titlerefdisplay) else: logging.debug("generateSubCollections: creating new subcollection %s"%found.reference) - manage_addVLP_subCollection(self,litid,found.titlerefdisplay,found.titlerefdisplay) + manage_addVLP_subCollection(self.getOrCreateFolderForFile(litid),litid,found.titlerefdisplay,found.titlerefdisplay) #teste ob es Images auf dem Server gibt mit gleichem Namen (frontmatter) if os.path.exists(os.path.join(self.vlp_basis,litid)): logging.debug("generateSubCollections: found frontmatter in %s"%litid) - obj=getattr(self,litid) + obj=self.findObjFromLitName(litid) if not self.ZopeFind(obj,obj_ids=[litid]): metalink=self.REQUEST['URL1']+"/"+litid+"/"+litid+"/index_meta" newObj=VLP_resource(litid,'',metalink,litid,litid,litid,'generated','book','','','','','','') @@ -592,7 +593,7 @@ class VLP_collection(ECHO_collection,Acq if RESPONSE is not None: self.REQUEST.RESPONSE.write("

%s

\n"%litid) - logging.debug("

%s

\n"%litid) + logging.debug("

%s

\n"%litid) except: error=sys.exc_info()[0:2]