version 1.30, 2004/10/14 09:48:50
|
version 1.31, 2004/11/03 15:02:53
|
Line 1
|
Line 1
|
|
""" |
|
This module contains extensions which where originally made for the VLP. |
|
""" |
|
|
from Products.ECHO_content.ECHO_collection import * |
from Products.ECHO_content.ECHO_collection import * |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
from Products.PageTemplates.PageTemplate import PageTemplate |
from Products.PageTemplates.PageTemplate import PageTemplate |
Line 13 import urllib
|
Line 17 import urllib
|
import xmlrpclib |
import xmlrpclib |
import vlp_xmlhelpers |
import vlp_xmlhelpers |
from types import * |
from types import * |
|
from Globals import package_home |
|
|
|
|
|
|
Line 52 class sendMailForm(ZopePageTemplate):
|
Line 57 class sendMailForm(ZopePageTemplate):
|
"""sendMailForm""" |
"""sendMailForm""" |
meta_type="sendMailForm" |
meta_type="sendMailForm" |
|
|
_default_content_fn = os.path.join(package_home(globals()), 'vlp/sendMail_template.zpt') |
_default_content_fn = os.path.join(package_home(globals()), 'vlp','sendMail_template.zpt') |
|
|
manage_options = ZopePageTemplate.manage_options+( |
manage_options = ZopePageTemplate.manage_options+( |
{'label':'Main Config','action':'main_configForm'}, |
{'label':'Main Config','action':'main_configForm'}, |
Line 157 class VLP_essay(Folder):
|
Line 162 class VLP_essay(Folder):
|
obj=getattr(self,type+"_template") |
obj=getattr(self,type+"_template") |
return obj() |
return obj() |
else: |
else: |
pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_%s_template_standard.zpt'%type).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','ECHO_%s_template_standard.zpt'%type)).__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
def ConfigVLP_essayForm(self): |
def ConfigVLP_essayForm(self): |
"""Form for adding""" |
"""Form for adding""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/ChangeVLP_essay.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','ChangeVLP_essay.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
def ChangeVLP_essay(self,title,label,description,RESPONSE=None): |
def ChangeVLP_essay(self,title,label,description,RESPONSE=None): |
Line 188 class VLP_essay(Folder):
|
Line 193 class VLP_essay(Folder):
|
if hasattr(self,'essayTemplate.html'): |
if hasattr(self,'essayTemplate.html'): |
return getattr(self,'essayTemplate.html')() |
return getattr(self,'essayTemplate.html')() |
|
|
pt=PageTemplateFile('Products/ECHO_content/vlp/essay_template.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','essay_template.zpt')).__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
Line 263 class VLP_essay(Folder):
|
Line 268 class VLP_essay(Folder):
|
|
|
def manage_addVLP_essayForm(self): |
def manage_addVLP_essayForm(self): |
"""Form for adding""" |
"""Form for adding""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/AddVLP_essay.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','AddVLP_essay.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
def manage_addVLP_essay(self, id,title,label,RESPONSE=None): |
def manage_addVLP_essay(self, id,title,label,RESPONSE=None): |
Line 288 class VLP_encyclopaedia(VLP_essay):
|
Line 293 class VLP_encyclopaedia(VLP_essay):
|
|
|
def loadNewFileForm(self): |
def loadNewFileForm(self): |
"""Neues XML-File einlesen""" |
"""Neues XML-File einlesen""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/VLP_newfile.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','VLP_newfile.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
def loadNewFile(self,RESPONSE=None): |
def loadNewFile(self,RESPONSE=None): |
Line 321 class VLP_encyclopaedia(VLP_essay):
|
Line 326 class VLP_encyclopaedia(VLP_essay):
|
|
|
def manage_addVLP_encycForm(self): |
def manage_addVLP_encycForm(self): |
"""Form for adding""" |
"""Form for adding""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/AddVLP_encyc.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','AddVLP_encyc.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
def manage_addVLP_encyc(self, id,title,label,RESPONSE=None): |
def manage_addVLP_encyc(self, id,title,label,RESPONSE=None): |
Line 346 class VLP_collection(ECHO_collection):
|
Line 351 class VLP_collection(ECHO_collection):
|
|
|
def VLP_path_configForm(self): |
def VLP_path_configForm(self): |
"""change pt""" |
"""change pt""" |
path=PageTemplateFile('Products/ECHO_content/vlp/ChangeVLPPath.zpt').__of__(self) |
path=PageTemplateFile(os.path.join(package_home(globals()),'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 404 class VLP_collection(ECHO_collection):
|
Line 409 class VLP_collection(ECHO_collection):
|
|
|
def manage_addVLP_collectionForm(self): |
def manage_addVLP_collectionForm(self): |
"""Form for adding a ressource""" |
"""Form for adding a ressource""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/AddVLP_collectionForm.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','AddVLP_collectionForm.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
|
|
Line 447 class VLP_resource(ECHO_resource):
|
Line 452 class VLP_resource(ECHO_resource):
|
if hasattr(self,'libraryTranscriptionTemplate.html'): |
if hasattr(self,'libraryTranscriptionTemplate.html'): |
return getattr(self,'libraryTranscriptionTemplate.html')() |
return getattr(self,'libraryTranscriptionTemplate.html')() |
|
|
pt=PageTemplateFile('Products/ECHO_content/vlp/library_transcriptionTemplate.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','library_transcriptionTemplate.zpt')).__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
Line 508 class VLP_resource(ECHO_resource):
|
Line 513 class VLP_resource(ECHO_resource):
|
if hasattr(self,'libraryTemplate.html'): |
if hasattr(self,'libraryTemplate.html'): |
return getattr(self,'libraryTemplate.html')() |
return getattr(self,'libraryTemplate.html')() |
|
|
pt=PageTemplateFile('Products/ECHO_content/vlp/library_template.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','library_template.zpt')).__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
Line 535 class VLP_resource(ECHO_resource):
|
Line 540 class VLP_resource(ECHO_resource):
|
def index_meta(self): |
def index_meta(self): |
"""index_meta""" |
"""index_meta""" |
|
|
pt=PageTemplateFile('Products/ECHO_content/vlp/index_meta.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','index_meta.zpt')).__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
Line 554 class VLP_resource(ECHO_resource):
|
Line 559 class VLP_resource(ECHO_resource):
|
"""dir to index""" |
"""dir to index""" |
|
|
def calculateName(str): |
def calculateName(str): |
ret="%s: %s"%(str[0],str[1:5]) |
name=os.path.splitext(str[1:])[0] |
|
ret="%s: %s"%(str[0],name) |
return ret |
return ret |
|
|
try: |
try: |
Line 564 class VLP_resource(ECHO_resource):
|
Line 570 class VLP_resource(ECHO_resource):
|
ret=os.listdir(os.path.join(self.vlp_basis,self.resourceID,'pagesHi')) |
ret=os.listdir(os.path.join(self.vlp_basis,self.resourceID,'pagesHi')) |
self.imagePath='pagesHi' |
self.imagePath='pagesHi' |
temp=[] |
temp=[] |
|
ret.sort() |
for x in ret: |
for x in ret: |
if not (x[0]=="."): |
if not (x[0]=="."): |
|
|
Line 663 class VLP_resource(ECHO_resource):
|
Line 670 class VLP_resource(ECHO_resource):
|
"""create index file""" |
"""create index file""" |
|
|
|
|
pt=PageTemplateFile('Products/ECHO_content/vlp/index_template.zpt').__of__(self)() |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','index_template.zpt')).__of__(self)() |
|
|
|
|
|
|
Line 682 class VLP_resource(ECHO_resource):
|
Line 689 class VLP_resource(ECHO_resource):
|
|
|
def manage_addVLP_resourceForm(self): |
def manage_addVLP_resourceForm(self): |
"""Form for adding a ressource""" |
"""Form for adding a ressource""" |
pt=PageTemplateFile('Products/ECHO_content/vlp/AddVLP_resourceForm.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'vlp','AddVLP_resourceForm.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
|
|