version 1.39, 2005/02/28 13:57:32
|
version 1.42, 2005/02/28 20:30:42
|
Line 338 def manage_addVLP_encyc(self, id,title,l
|
Line 338 def manage_addVLP_encyc(self, id,title,l
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
class VLP_subcollection(ECHO_collection): |
|
""" subcollection of elements""" |
|
|
|
meta_type="VLP_subcollection" |
|
def generateSubCollectionFromDB(self): |
|
"""erzeuge subcollection""" |
|
for item in self.ZSQLSimpleSearch("select * from vl_literature where volumeid like '%s'"%self.id): |
|
manage_addECHO_link(self,item.reference,item.titlerefdisplay,item.titlerefdisplay) |
|
|
|
def index_html(self): |
|
"""erzeuge darstellung""" |
|
pt=zptFile(self, 'vlp/collection_template.zpt') |
|
return pt() |
|
|
|
|
|
def manage_addVLP_subCollection(self,id,title,label,RESPONSE=None): |
|
|
|
self._setObject(id,VLP_subcollection(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""" |
|
|
|
|
meta_type="VLP_collection" |
meta_type="VLP_collection" |
manage_options=ECHO_collection.manage_options+( |
manage_options=ECHO_collection.manage_options+( |
{'label':'Change Path','action':'VLP_path_configForm'}, |
{'label':'Change Path','action':'VLP_path_configForm'}, |
Line 349 class VLP_collection(ECHO_collection):
|
Line 372 class VLP_collection(ECHO_collection):
|
{'label':'Update Metadata','action':'updateCollectionMD'}, |
{'label':'Update Metadata','action':'updateCollectionMD'}, |
) |
) |
|
|
|
|
|
def generateSubCollections(self): |
|
"""erzeuge subcollectionen""" |
|
founds=self.ZSQLSimpleSearch("select * from vl_literature where referencetype in ('(Book)','(Collection)','(Journal)','(Library)')") |
|
|
|
self.REQUEST.RESPONSE.write("<html><body>\n") |
|
for found in founds: |
|
|
|
foundCol=self.ZopeFind(self,obj_ids=[found.reference]) |
|
if foundCol: |
|
self.manage_delObjects([foundCol[0][0]]) |
|
|
|
manage_addVLP_subCollection(self,found.reference,found.titlerefdisplay,found.titlerefdisplay) |
|
#getattr(self,found.reference).generateSubCollectionFromDB() |
|
|
|
self.REQUEST.RESPONSE.write("<p>%s</p>\n"%found.reference) |
|
|
|
|
def VLP_path_configForm(self): |
def VLP_path_configForm(self): |
"""change pt""" |
"""change pt""" |
path=PageTemplateFile(os.path.join(package_home(globals()),'vlp','ChangeVLPPath.zpt')).__of__(self) |
path=PageTemplateFile(os.path.join(package_home(globals()),'vlp','ChangeVLPPath.zpt')).__of__(self) |
Line 480 class VLP_resource(ECHO_resource,Cacheab
|
Line 521 class VLP_resource(ECHO_resource,Cacheab
|
if founds: |
if founds: |
|
|
for found in founds: |
for found in founds: |
print "XXXXXX",found,self.resourceID |
|
text=found.transcript |
text=found.transcript |
if not text: text="" |
if not text: text="" |
ret+="<page><pb/>"+text+"</page>" |
ret+="<page><pb/>"+text+"</page>" |
Line 498 class VLP_resource(ECHO_resource,Cacheab
|
Line 539 class VLP_resource(ECHO_resource,Cacheab
|
else: |
else: |
|
|
self._setObject('fulltext',ECHO_fullText(id,'')) |
self._setObject('fulltext',ECHO_fullText(id,'')) |
|
|
try: |
try: |
getattr(self,'fulltext').pt_edit(re3.encode('utf-8','ignore'),'text/xml') |
getattr(self,'fulltext').pt_edit(re3.encode('utf-8','ignore'),'text/xml') |
except: |
except: |
getattr(self,'fulltext').pt_edit(re3,'text/xml') |
getattr(self,'fulltext').pt_edit(re3.encode('latin-1').decode('utf-8'),'text/xml') |
|
|
return "FT: %s"%self.getId() |
return "FT: %s"%self.getId() |
else: |
else: |
return "no: %s"%self.getId() |
return "no: %s"%self.getId() |
Line 580 class VLP_resource(ECHO_resource,Cacheab
|
Line 623 class VLP_resource(ECHO_resource,Cacheab
|
def dir2index(self): |
def dir2index(self): |
"""dir to index""" |
"""dir to index""" |
|
|
|
excludeNames=['Icon'] |
|
|
def calculateName(str): |
def calculateName(str): |
name=os.path.splitext(str[1:])[0] |
name=os.path.splitext(str[1:])[0] |
ret="%s: %s"%(str[0],name) |
ret="%s: %s"%(str[0],name) |
Line 594 class VLP_resource(ECHO_resource,Cacheab
|
Line 639 class VLP_resource(ECHO_resource,Cacheab
|
temp=[] |
temp=[] |
ret.sort() |
ret.sort() |
for x in ret: |
for x in ret: |
if not (x[0]=="."): |
if (not (x[0]==".")) and (not x[0:4] in excludeNames): |
|
|
temp.append((calculateName(x),os.path.splitext(x)[0])) |
temp.append((calculateName(x),os.path.splitext(x)[0])) |
return temp |
return temp |