version 1.48, 2005/09/13 16:10:44
|
version 1.55, 2006/02/13 16:41:49
|
Line 230 class VLP_essay(Folder):
|
Line 230 class VLP_essay(Folder):
|
|
|
pages.sort(sortFind) |
pages.sort(sortFind) |
#print str(pages[int(pagenum)][1]()) |
#print str(pages[int(pagenum)][1]()) |
|
|
if pages[int(pagenum)-1][1].meta_type=='File': |
if pages[int(pagenum)-1][1].meta_type=='File': |
|
|
#return makeXML(str(pages[int(pagenum)-1][1])) |
#return makeXML(str(pages[int(pagenum)-1][1])) |
Line 346 class VLP_subcollection(ECHO_collection)
|
Line 347 class VLP_subcollection(ECHO_collection)
|
|
|
meta_type="VLP_subcollection" |
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' """%self.getId() |
|
+ """ %s AND not referenceType='%s' """%(online,type) |
|
+ """ORDER BY """ + sort)] |
|
|
|
tocItem = [x for x in self.ZSQLSimpleSearch("""SELECT * FROM vl_literature |
|
WHERE volumeid = '%s' """%self.getId() |
|
+ """AND online = 1 AND referenceType='%s' """%type |
|
+ """ORDER BY """ + sort)] |
|
|
|
|
|
|
|
return tocItem+item |
|
|
def checkForFrontMatter(self,item): |
def checkForFrontMatter(self,item): |
"""Teste ob Frontmatter exists""" |
"""Teste ob Frontmatter exists""" |
if not item==self.getId(): |
if not item==self.getId(): |
Line 395 class VLP_collection(ECHO_collection):
|
Line 426 class VLP_collection(ECHO_collection):
|
|
|
def generateSubCollections(self,errorsTXT=""): |
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 ('(Edited Book)','(Book)','(Collection)','(JournalVolume)')") |
|
|
self.REQUEST.RESPONSE.write("<h2>Create Subcollections</h2>\n") |
self.REQUEST.RESPONSE.write("<h2>Create Subcollections</h2>\n") |
for found in founds: |
for found in founds: |
|
|
try: |
try: |
foundCol=self.ZopeFind(self,obj_ids=[found.reference]) |
foundCol=self.ZopeFind(self,obj_ids=[found.reference]) |
if foundCol: |
if foundCol: |
Line 444 class VLP_collection(ECHO_collection):
|
Line 476 class VLP_collection(ECHO_collection):
|
files=os.listdir(self.vlp_basis) |
files=os.listdir(self.vlp_basis) |
|
|
errorsTXT+="<h3>New Ressources</h3>" |
errorsTXT+="<h3>New Ressources</h3>" |
|
|
for fileName in files: |
for fileName in files: |
|
|
if fileName[0:3]=="lit": |
if fileName[0:3]=="lit": |
Line 810 class VLP_resource(ECHO_resource,Cacheab
|
Line 843 class VLP_resource(ECHO_resource,Cacheab
|
def readIndexFile(self,url=None): |
def readIndexFile(self,url=None): |
"""reads the indexfile. presently url not None isn't implemented. In the future url can be defined.""" |
"""reads the indexfile. presently url not None isn't implemented. In the future url can be defined.""" |
if not url: |
if not url: |
url=self.absolute_url()+"/index.xml" |
urlTmp=self.absolute_url()+"/index.xml" |
|
|
if self.ZCacheable_isCachingEnabled(): |
if self.ZCacheable_isCachingEnabled(): |
|
|
result = self.ZCacheable_get(view_name=url) |
result = self.ZCacheable_get(view_name=urlTmp) |
if result is not None: |
if result is not None: |
# Got a cached value. |
# Got a cached value. |
return result |
return result |
|
|
pagelist=[] |
pagelist=[] |
|
|
fh=ECHO_helpers.urlopen(url) |
if not url: |
|
|
|
xmlTxt=getattr(self,'index.xml')() |
|
dom=xml.dom.minidom.parseString(xmlTxt) |
|
else: |
|
fh=ECHO_helpers.urlopen(urlTmp) |
dom=xml.dom.minidom.parse(fh) |
dom=xml.dom.minidom.parse(fh) |
|
|
|
|
Line 831 class VLP_resource(ECHO_resource,Cacheab
|
Line 869 class VLP_resource(ECHO_resource,Cacheab
|
fileName=page.getAttribute('file') |
fileName=page.getAttribute('file') |
pagelist.append((pageNum,text,fileName)) |
pagelist.append((pageNum,text,fileName)) |
|
|
self.ZCacheable_set(pagelist,view_name=url) |
self.ZCacheable_set(pagelist,view_name=urlTmp) |
return pagelist |
return pagelist |
|
|
def getFileName(self): |
def getFileName(self): |