version 1.3, 2004/05/28 15:01:43
|
version 1.6, 2004/06/08 15:25:11
|
Line 13 def getText(nodelist):
|
Line 13 def getText(nodelist):
|
rc = rc + node.data |
rc = rc + node.data |
return rc |
return rc |
|
|
|
class VLP_essay(Folder): |
|
"""classe für VLP essays""" |
|
|
|
meta_type="VLP_essay" |
|
|
|
def __init__(self,id,title,label): |
|
"""init""" |
|
self.id=id |
|
self.title=title |
|
self.label=label |
|
|
|
def getPage(self,pagenum): |
|
"""gibt essay page mit num aus""" |
|
def sortFind(x,y): |
|
return cmp(x[0],y[0]) |
|
|
|
pages=self.ZopeFind(self,obj_metatypes=['DTML Document','File']) |
|
|
|
pages.sort(sortFind) |
|
#print str(pages[int(pagenum)][1]()) |
|
if pages[int(pagenum)-1][1].meta_type=='File': |
|
return str(pages[int(pagenum)-1][1]) |
|
else: |
|
return str(pages[int(pagenum)-1][1]()) |
|
|
|
def nextPage(self,pagenum,url): |
|
pages=len(self.ZopeFind(self,obj_metatypes=['DTML Document'])) # teste ob performance ok, sonst in variable |
|
if int(pagenum)+1 <= pages: |
|
retstr=url+"?p="+str(int(pagenum)+1) |
|
return """<td align="right" <a href="%s">next</a></td>"""%retstr |
|
|
|
def previousPage(self,pagenum,url): |
|
pages=len(self.ZopeFind(self,obj_metatypes=['DTML Document'])) # teste ob performance ok, sonst in variable |
|
if int(pagenum)-1 > 0: |
|
retstr=url+"?p="+str(int(pagenum)-1) |
|
return """<td align="left" <a href="%s">previous</a></td>"""%retstr |
|
|
|
|
|
def manage_addVLP_essayForm(self): |
|
"""Form for adding""" |
|
pt=PageTemplateFile('Products/ECHO_content/vlp/AddVLP_essay.zpt').__of__(self) |
|
return pt() |
|
|
|
def manage_addVLP_essay(self, id,title,label,RESPONSE=None): |
|
"""add the copyright""" |
|
|
|
|
|
self._setObject(id, VLP_essay(id, title,label)) |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
|
|
class VLP_collection(ECHO_collection): |
class VLP_collection(ECHO_collection): |
"""VLP spezifische Erweiterung der Collection""" |
"""VLP spezifische Erweiterung der Collection""" |
|
|
Line 24 class VLP_collection(ECHO_collection):
|
Line 78 class VLP_collection(ECHO_collection):
|
) |
) |
|
|
def VLP_path_configForm(self): |
def VLP_path_configForm(self): |
"""change path""" |
"""change pt""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/ChangeVLPPath.zpt').__of__(self) |
path=PageTemplateFile('Products/ECHO_content/vlp/ChangeVLPPath.zpt').__of__(self) |
return pt() |
return pt() |
|
|
def VLP_path_config(self,path,RESPONSE=None): |
def VLP_path_config(self,path,RESPONSE=None): |
Line 56 class VLP_collection(ECHO_collection):
|
Line 110 class VLP_collection(ECHO_collection):
|
"""updateMD""" |
"""updateMD""" |
files=os.listdir(self.path) |
files=os.listdir(self.path) |
for fileName in files: |
for fileName in files: |
if fileName[0:5]=="lit11": |
if fileName[0:3]=="lit": |
genObj=getattr(self,fileName) |
genObj=getattr(self,fileName) |
genObj.copyIndex_meta2echo_resource() |
genObj.copyIndex_meta2echo_resource() |
genObj.generate_title() |
genObj.generate_title() |