--- ECHO_content/VLPExtension.py 2008/11/16 12:15:42 1.83 +++ ECHO_content/VLPExtension.py 2008/11/20 10:45:14 1.84 @@ -520,7 +520,7 @@ class VLP_collection(ECHO_collection,Acq actual_url=request['ACTUAL_URL'] lastActual=actual_url.split("/")[-1] - + logging.debug("pub_trav:"+actual_url) if name.startswith("lit"): #umleitung wenn lit aufgerufen wirk # umleitung auf den eigentlichen folder nur wenn direkt der Folder litXXX oder dessen index_html methode aufgerufen wird @@ -531,7 +531,7 @@ class VLP_collection(ECHO_collection,Acq return "LIt not found" else: - logging.error("request:"+repr(ob)) + logging.debug("request:"+repr(ob)) request.response.setStatus(200) #if (lastActual=="index_meta"): # logging.debug("index_meta requested") @@ -582,7 +582,8 @@ class VLP_collection(ECHO_collection,Acq if foundCol: col = foundCol logging.debug("generateSubCollections: subcollection %s exists (%s)"%(repr(col),found.reference)) - if (col.title != found.titlerefdisplay) or (col.label != found.titlerefdisplay): + logging.debug(repr([col.title,found.titlerefdisplay,col.label,found.titlerefdisplay])) + if (unicodify(col.title) != found.titlerefdisplay) or (unicodify(col.label) != found.titlerefdisplay): # subcollection seems to have changed logging.debug("generateSubCollections: subcollection has changed, recreating!") col.aq_parent.manage_delObjects([col.getId()]) @@ -611,11 +612,12 @@ class VLP_collection(ECHO_collection,Acq error=sys.exc_info()[0:2] logging.error("generateSubCollections: ERROR in %s"%litid) if RESPONSE is not None: + RESPONSE.write("

(ERROR updateII(%s): %s %s TXT: %s)\n

"%(litid,error[0],error[1],sys.exc_info()[2])) RESPONSE.write("

(ERROR (%s): %s %s)

\n"%(litid,error[0],error[1])) - #logging.error("generateSubCollections: %s %s"%error) - #self.REQUEST.RESPONSE.write("(ERROR (%s): %s %s)\n"%(litid,repr(error[0]),repr(error[1]))) + logging.error("generateSubCollections: %s %s"%error) + self.REQUEST.RESPONSE.write("(ERROR (%s): %s %s)\n"%(litid,repr(error[0]),repr(error[1]))) errorsTXT+="

ERROR: No subcollection of %s (ERROR: %s %s)

\n"%(litid,error[0],error[1]) - #errorsTXT+="

No subcollection of %s "%litid+"(ERROR: %s %s)

"%error + errorsTXT+="

No subcollection of %s "%litid+"(ERROR: %s %s)

"%error return errorsTXT @@ -653,8 +655,9 @@ class VLP_collection(ECHO_collection,Acq return current - def updateCollection(self,forceUpdate=False,RESPONSE=None): - """liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" + def changeOrAddResources(self,forceUpdate=False,RESPONSE=None): + """changes ord updates all resources found in the file system""" + errorsTXT="

Errors

" if RESPONSE is not None: RESPONSE.setHeader('Content-Type','text/html') @@ -711,7 +714,7 @@ class VLP_collection(ECHO_collection,Acq except: error=sys.exc_info()[0:2] if RESPONSE is not None: - RESPONSE.write("(ERROR (%s): %s %s) "%(fileName,error[0],error[1])) + RESPONSE.write("(ERROR Update(%s): %s %s %s) "%(fileName,error[0],error[1],sys.exc_info()[2])) errorsTXT+="

ERROR creating index for %s "%fileName+"(ERROR: %s %s)

\n"%error # update pageSizeSum for subcollections @@ -730,10 +733,16 @@ class VLP_collection(ECHO_collection,Acq error=sys.exc_info()[0:2] logging.error("updateCollection: ERROR in %s (%s %s)"%(fileName,error[0],error[1])) if RESPONSE is not None: - RESPONSE.write("

(ERROR (%s): %s %s)

\n"%(fileName,error[0],error[1])) + RESPONSE.write("(ERROR updateII(%s): %s %s %s) "%(fileName,error[0],error[1],sys.exc_info()[2])) errorsTXT+="

File not created:%s (ERROR: %s %s)

\n"%(fileName,error[0],error[1]) - - # update subcollections + return errorsTXT + + def updateCollection(self,forceUpdate=False,RESPONSE=None): + """liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" + + # update subcollections + errorsTXT="" + errorsTXT+=self.changeOrAddResources(forceUpdate, RESPONSE); errorsTXT+=self.generateSubCollections(forceUpdate=forceUpdate,RESPONSE=RESPONSE) errorsTXT+="\n" if RESPONSE is not None: