version 1.46, 2005/06/08 07:07:27
|
version 1.47, 2005/09/12 16:42:10
|
Line 16 import xml.dom.minidom
|
Line 16 import xml.dom.minidom
|
import urllib |
import urllib |
import xmlrpclib |
import xmlrpclib |
import vlp_xmlhelpers |
import vlp_xmlhelpers |
|
import sys |
from types import * |
from types import * |
from Globals import package_home |
from Globals import package_home |
|
|
Line 390 class VLP_collection(ECHO_collection):
|
Line 391 class VLP_collection(ECHO_collection):
|
|
|
|
|
|
|
def generateSubCollections(self): |
def generateSubCollections(self,errorsTXT=""): |
"""erzeuge subcollectionen""" |
"""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 ('(Book)','(Collection)','(Journal)')") |
|
|
self.REQUEST.RESPONSE.write("<html><body>\n") |
self.REQUEST.RESPONSE.write("<h2>Create Subcollections</h2>\n") |
for found in founds: |
for found in founds: |
|
try: |
foundCol=self.ZopeFind(self,obj_ids=[found.reference]) |
foundCol=self.ZopeFind(self,obj_ids=[found.reference]) |
if foundCol: |
if foundCol: |
|
|
Line 416 class VLP_collection(ECHO_collection):
|
Line 417 class VLP_collection(ECHO_collection):
|
genObj.createIndexFile() |
genObj.createIndexFile() |
|
|
self.REQUEST.RESPONSE.write("<p>%s</p>\n"%found.reference) |
self.REQUEST.RESPONSE.write("<p>%s</p>\n"%found.reference) |
|
except: |
|
error=sys.exc_info()[0:2] |
|
RESPONSE.write("(ERROR: %s %s)\n"%error) |
|
errorsTXT+="<p>No subcollection of %s "+"(ERROR: %s %s)</p>"%error |
|
|
|
return errorsTXT |
|
|
def VLP_path_configForm(self): |
def VLP_path_configForm(self): |
"""change pt""" |
"""change pt""" |
Line 431 class VLP_collection(ECHO_collection):
|
Line 437 class VLP_collection(ECHO_collection):
|
|
|
def updateCollection(self,RESPONSE=None): |
def updateCollection(self,RESPONSE=None): |
"""liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" |
"""liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" |
|
errorsTXT="<h2>Errors</h2>" |
|
RESPONSE.write("<html><body>") |
files=os.listdir(self.vlp_basis) |
files=os.listdir(self.vlp_basis) |
|
|
|
errorsTXT+="<h3>New Ressources</h3>" |
for fileName in files: |
for fileName in files: |
|
|
if fileName[0:3]=="lit": |
if fileName[0:3]=="lit": |
|
|
metalink=self.REQUEST['URL1']+"/"+fileName+"/index_meta" |
metalink=self.REQUEST['URL1']+"/"+fileName+"/index_meta" |
|
try: |
if not hasattr(self,fileName): |
if not hasattr(self,fileName): |
newObj=VLP_resource(fileName,'',metalink,fileName,fileName,fileName,'generated','book','','','','','','') |
newObj=VLP_resource(fileName,'',metalink,fileName,fileName,fileName,'generated','book','','','','','','') |
self._setObject(fileName,newObj) |
self._setObject(fileName,newObj) |
|
|
RESPONSE.write("got: %s\n"%fileName) |
RESPONSE.write("<p>got: %s\n</p>"%fileName) |
genObj=getattr(self,fileName) |
genObj=getattr(self,fileName) |
if hasattr(genObj,'createIndexFile'): |
if hasattr(genObj,'createIndexFile'): |
|
try: |
genObj.createIndexFile() |
genObj.createIndexFile() |
|
except: |
self.generateSubCollections() |
error=sys.exc_info()[0:2] |
|
RESPONSE.write("<p>(ERROR: %s %s)</p>\n"%error) |
|
errorsTXT+="<p>No indexfile of %s "+"(ERROR: %s %s)</p>"%error |
|
except: |
|
error=sys.exc_info()[0:2] |
|
RESPONSE.write("<p>(ERROR: %s %s)</p>\n"%error) |
|
errorsTXT+="<p>File not created:%s "+"(ERROR: %s %s)</p>"%error |
|
|
|
errorsTXT+=self.generateSubCollections() |
|
errorsTXT+="/n" |
|
RESPONSE.write(errorsTXT) |
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|